Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Commit

Permalink
Add more struct ToString()s, show info checkbox, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
BlockBuilder57 committed May 12, 2019
1 parent ee0ef88 commit 94ff0d3
Show file tree
Hide file tree
Showing 7 changed files with 303 additions and 5 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# XBC2ModelDecomp
A reformatted fork of a [project created by daemon1](https://forum.xentax.com/viewtopic.php?f=16&t=18087) on the XeNTaX forums. All credit to them and to [PredatorCZ/Lukas Cone](https://lukascone.wordpress.com/2018/05/06/xenoblade-chronicles-import-tool/) for publicizing tools to reverse the game's various model formats. Special thanks to Turk645 as well for working on the map formats and for bouncing ideas back and forth with.
## Features
* Dump model meshes, bones, and flexes to XNALara ascii or glTF (but with no bones)
* Dump textures from .wismt
* Dump animations
* Dumps raw files from map files
## Running
Simply run the executable, and pick an input file. The only supported filetypes (at the time of writing) are \*.wimdo for models and \*.wismda for maps. An output folder will automatically be selected for the file(s) you choose, but you can override this by picking a output folder manually. Configure your output settings at the bottom and hit Extract. If you are using Blender, it does not natively support the XNALara format; I recommend [johnzero7's plugin.](https://github.com/johnzero7/XNALaraMesh) Many other plugins exist for other modeling tools.
## Compiling
Expand Down
3 changes: 2 additions & 1 deletion XBC2ModelDecomp/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ public partial class App : Application
public static bool ExportTextures;
public static bool ExportFlexes;
public static bool ExportAnims;
public static bool SaveRawFiles;
public static bool ExportOutlines;
public static bool ShowInfo;
public static bool SaveRawFiles;
public static int LOD;
public static Structs.ExportFormat ExportFormat = Structs.ExportFormat.XNALara;

Expand Down
10 changes: 9 additions & 1 deletion XBC2ModelDecomp/FormatTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,15 @@ public void ReadTextures(Structs.MSRD MSRD, string texturesFolderPath)
break;
}

string filename = $@"{texturesFolderPath}\{i.ToString("d2")}.{(MSRD.TextureIdsCount == MSRD.FileCount - 2 ? MSRD.TextureNames[MSRD.TextureIds[i]] : DataTextureNames[i])}";
string filename = $@"{texturesFolderPath}\cool song.mp3.exe";
try
{
filename = $@"{texturesFolderPath}\{i.ToString("d2")}.{(MSRD.TextureIdsCount == MSRD.FileCount - 2 ? MSRD.TextureNames[MSRD.TextureIds[i]] : DataTextureNames[i])}";
}
catch
{
filename = $@"{texturesFolderPath}\{i.ToString("d2")}.i couldnt find the filename sorry";
}

FileStream fsTexture;
if (TextureTypeArray[i] == 37)
Expand Down
1 change: 1 addition & 0 deletions XBC2ModelDecomp/MainFormTest.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<Slider x:Name="EXsldLOD" Grid.Column="0" Grid.Row="3" Margin="350,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Maximum="3" Minimum="-1" SmallChange="1" Value="0" Width="100" TickPlacement="BottomRight" Height="30" AutoToolTipPlacement="TopLeft" ValueChanged="EXsldLOD_ValueChanged"/>

<Button x:Name="EXbtnExtract" Content="Extract" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" Margin="0,6,0,0" VerticalAlignment="Top" Width="60" Height="20" Click="ExtractFile"/>
<CheckBox x:Name="EXcbxShowInfo" Content="Info" ToolTip="Each struct of the model will have its data outputted to the console." HorizontalAlignment="Left" Margin="0,30,0,0" Grid.Column="1" Grid.Row="2" VerticalAlignment="Top"/>
</Grid>
</TabItem>
<TabItem x:Name="tabConsole" Header="Console">
Expand Down
1 change: 1 addition & 0 deletions XBC2ModelDecomp/MainFormTest.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ private void ExtractFile(object sender, RoutedEventArgs e)
App.ExportAnims = EXcbxAnims.IsChecked.Value;
App.ExportOutlines = EXcbxOutlines.IsChecked.Value;
App.SaveRawFiles = EXcbxRawFiles.IsChecked.Value;
App.ShowInfo = EXcbxShowInfo.IsChecked.Value;
App.LOD = (int)EXsldLOD.Value;
App.ExportFormat = (Structs.ExportFormat)EXdropFormat.SelectedIndex;

Expand Down
8 changes: 7 additions & 1 deletion XBC2ModelDecomp/ModelTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public ModelTools()
BinaryReader brWISMT = new BinaryReader(fsWISMT);

Structs.MSRD MSRD = ft.ReadMSRD(fsWISMT, brWISMT);
App.PushLog(MSRD.ToString());

if (App.ExportAnims && File.Exists(App.CurFilePath.Remove(App.CurFilePath.LastIndexOf('.')) + ".mot"))
{
Expand Down Expand Up @@ -74,6 +73,13 @@ public ModelTools()
Structs.SKEL SKEL = ft.ReadSKEL(brSKEL.BaseStream, brSKEL);
#endregion ARCReading

if (App.ShowInfo)
{
App.PushLog(MSRD.ToString());
App.PushLog(Mesh.ToString());
App.PushLog(MXMD.ToString());
}

switch (App.ExportFormat)
{
case Structs.ExportFormat.XNALara:
Expand Down
Loading

0 comments on commit 94ff0d3

Please sign in to comment.