KillzXGaming / Switch-Toolbox

A tool to edit many video game file formats
GNU General Public License v3.0
946 stars 151 forks source link

DAE/FBX Exporting results in #45

Closed Yoshimaster96 closed 5 years ago

Yoshimaster96 commented 5 years ago

Whenever I try to export a DAE or FBX of a model I opened as a BFRES, I get an IndexOutOfRange exception.

Steps:

  1. Open a BFRES file (I tried Doshi.bfres from Super Mario Odyssey, but it seems to happen with other models from SMO too)
  2. Open the "Models" folder in the tree
  3. Right click the model (should have a cube next to it) and select "Export". Save as whatever.
  4. ERROR
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Switch_Toolbox.Library.AssimpData.SaveFromModel(STGenericModel model, String FileName, STSkeleton skeleton, List`1 NodeArray)
   at Bfres.Structs.FMDL.Export(Object sender, EventArgs args) in C:\Users\Nathan\Documents\GitHub\Switch_Toolbox\Switch-Toolbox-38ceb8d7163902ecb569774ab4db327a194d6f99\Switch_FileFormatsMain\FileFormats\BFRES\Bfres Structs\FMDL.cs:line 457
   at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.MenuItem.MenuItemData.Execute()
   at System.Windows.Forms.Command.Invoke()
   at System.Windows.Forms.Command.DispatchID(Int32 id)
   at System.Windows.Forms.Control.WmCommand(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.TreeView.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3362.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Switch_Toolbox
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/Switch_Toolbox.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3324.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3362.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Switch_Toolbox.Library
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/lib/Switch_Toolbox.Library.DLL
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3362.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
WeifenLuo.WinFormsUI.Docking
    Assembly Version: 3.0.4.0
    Win32 Version: 3.0.4.0
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/lib/WeifenLuo.WinFormsUI.Docking.DLL
----------------------------------------
WeifenLuo.WinFormsUI.Docking.ThemeVS2015
    Assembly Version: 3.0.4.0
    Win32 Version: 3.0.4.0
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/lib/WeifenLuo.WinFormsUI.Docking.ThemeVS2015.DLL
----------------------------------------
System.Xml.Linq
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
----------------------------------------
GL_Core
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/GL_Core.DLL
----------------------------------------
FirstPlugin.Plg
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/Lib/Plugins/FirstPlugin.Plg.dll
----------------------------------------
Syroot.NintenTools.NSW.Bfres
    Assembly Version: 1.2.3.0
    Win32 Version: 1.2.3.0
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/lib/Syroot.NintenTools.NSW.Bfres.DLL
----------------------------------------
Syroot.Maths
    Assembly Version: 1.5.0.0
    Win32 Version: 1.5.0.0
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/lib/Syroot.Maths.DLL
----------------------------------------
OpenTK
    Assembly Version: 3.0.1.0
    Win32 Version: 3.0.1
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/lib/OpenTK.DLL
----------------------------------------
Syroot.NintenTools.Bfres
    Assembly Version: 1.2.3.0
    Win32 Version: 1.2.3.0
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/lib/Syroot.NintenTools.Bfres.DLL
----------------------------------------
Syroot.NintenTools.NSW.Bntx
    Assembly Version: 1.2.3.0
    Win32 Version: 1.2.3.0
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/lib/Syroot.NintenTools.NSW.Bntx.DLL
----------------------------------------
BarsLibrary
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/lib/BarsLibrary.DLL
----------------------------------------
OpenTK.GLControl
    Assembly Version: 3.0.1.0
    Win32 Version: 3.0.1
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/lib/OpenTK.GLControl.DLL
----------------------------------------
Octokit
    Assembly Version: 0.31.0.0
    Win32 Version: 0.31.0.0
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/Octokit.DLL
----------------------------------------
System.Net.Http
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Net.Http/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Net.Http.dll
----------------------------------------
SFGraphics
    Assembly Version: 1.0.6842.8428
    Win32 Version: 1.0.6842.8428
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/lib/SFGraphics.DLL
----------------------------------------
Syroot.BinaryData
    Assembly Version: 2.0.1.0
    Win32 Version: 2.0.1.0
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/lib/Syroot.BinaryData.DLL
----------------------------------------
Anonymously Hosted DynamicMethods Assembly
    Assembly Version: 0.0.0.0
    Win32 Version: 4.7.3362.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
SARCExt
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/lib/SARCExt.DLL
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
AssimpNet
    Assembly Version: 4.1.0.0
    Win32 Version: 4.1.0
    CodeBase: file:///C:/Users/jacob/Desktop/Gaming/WiiU+Switch/Modding/SuperMarioOdyssey/Files/Tools/SwitchToolbox/lib/AssimpNet.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
KillzXGaming commented 5 years ago

You are using an old toolbox build. The latest experimental fixes this.

Yoshimaster96 commented 5 years ago

I tried the experimental build, and it still happens.

KillzXGaming commented 5 years ago

Can you send the error that the latest build gives?

KillzXGaming commented 5 years ago

Edit: Now it's working by commit https://github.com/KillzXGaming/Switch-Toolbox/commit/bab9ce9022796f4e625146b734e87859692ec9d4