Closed Ebola16 closed 6 years ago
It looks like when BrawlBox is in the process of showing the material reference, it loads one of the materials (not sure if it's that one or not) which causes a Palettes group to be added to the model (it didn't have one before) and that throws off the foreach loop.
I could probably make a copy of the collection before I go through it - any situation where that would change the result would, at the moment, result in a crash, so I think I'm OK.
In the meantime, it should work if you replace the materials, close the file, and open it again.
Yes, closing and reopening the file does work around the issue.
Should be fixed now.
LGTM, thanks!
Collection was modified; enumeration operation may not execute. at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Collections.Generic.List
1.Enumerator.MoveNextRare() at System.Collections.Generic.List
1.Enumerator.MoveNext() at BrawlLib.SSBB.ResourceNodes.ResourceNode.FindChild(String path, Boolean searchChildren) at BrawlLib.SSBB.ResourceNodes.ResourceNode.FindChild(String path, Boolean searchChildren) at BrawlLib.SSBB.ResourceNodes.ResourceNode.FindChild(String path, Boolean searchChildren) at BrawlLib.SSBB.ResourceNodes.ResourceNode.FindChild(String path, Boolean searchChildren) at BrawlLib.SSBB.ResourceNodes.MDL0TextureNode.Load(Int32 index, Int32 program) at BrawlLib.SSBB.ResourceNodes.MDL0TextureNode.Prepare(MDL0MaterialRefNode mRef, Int32 shaderProgramHandle, String palette) at System.Windows.Forms.TexCoordRenderer.SetTarget(MDL0MaterialRefNode texture) at System.Windows.Forms.TexCoordRenderer.set_TargetNode(MDL0MaterialRefNode value) at System.Windows.Forms.TexCoordControl.set_TargetNode(MDL0MaterialRefNode value) at BrawlBox.MainForm.resourceTree_SelectionChanged(Object sender, EventArgs e) in C:\Users\Ryan!\Source\Repos\brawltools\BrawlBox\UI\MainForm.cs:line 490 at System.EventHandler.Invoke(Object sender, EventArgs e) at BrawlBox.ResourceTree.set_SelectedNode(TreeNode value) in C:\Users\Ryan!\Source\Repos\brawltools\BrawlBox\UI\ResourceTree.cs:line 112 at BrawlBox.ResourceTree.OnAfterSelect(TreeViewEventArgs e) in C:\Users\Ryan!\Source\Repos\brawltools\BrawlBox\UI\ResourceTree.cs:line 210 at System.Windows.Forms.TreeView.TvnSelected(NMTREEVIEW* nmtv) at System.Windows.Forms.TreeView.WmNotify(Message& m) at System.Windows.Forms.TreeView.WndProc(Message& m) at BrawlBox.ResourceTree.WndProc(Message& m) in C:\Users\Ryan!\Source\Repos\brawltools\BrawlBox\UI\ResourceTree.cs:line 181 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)Steps to reproduce:
Also, if you want the completed version of the attached Corrin (Female) import, it can be found here http://forums.kc-mm.com/Gallery/BrawlView.php?Number=214921