diff --git a/.gitignore b/.gitignore index f97e413a..7172832e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ Debug/ Release/ BrawlboxHelper/BrawlHelperTest2.cs BrawlboxHelper/BrawlHelperTest2.zip +Toolbox/Lib.zip diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index 47f918a7..9596c2bf 100644 Binary files a/.vs/Switch_Toolbox/v15/.suo and b/.vs/Switch_Toolbox/v15/.suo differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide index 816fc49d..7b01aaf6 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal index 0ae78d3f..a7fdb415 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Switch_FileFormatsMain/FileFormats/BMD/BMD.cs b/Switch_FileFormatsMain/FileFormats/BMD/BMD.cs index 05cc30ad..341e82fe 100644 --- a/Switch_FileFormatsMain/FileFormats/BMD/BMD.cs +++ b/Switch_FileFormatsMain/FileFormats/BMD/BMD.cs @@ -95,6 +95,7 @@ namespace FirstPlugin public DrawableContainer DrawableContainer = new DrawableContainer(); public Model BMDFile; + public STSkeleton Skeleton; private TreeNode TextureFolder; private TreeNode ShapeFolder; private TreeNode MaterialFolder; @@ -107,12 +108,24 @@ namespace FirstPlugin //Set renderer Renderer = new BMD_Renderer(); + Skeleton = new STSkeleton(); + DrawableContainer.Name = FileName; DrawableContainer.Drawables.Add(Renderer); + DrawableContainer.Drawables.Add(Skeleton); + Textures = new Dictionary(); BMD_Renderer.TextureContainers.Add(this); + BMDFile = Model.Load(stream); + LoadBMD(BMDFile); + } + + private void LoadBMD(Model model) + { + Nodes.Clear(); + ShapeFolder = new TreeNode("Shapes"); SkeletonFolder = new TreeNode("Skeleton"); MaterialFolder = new TreeNode("Materials"); @@ -122,13 +135,12 @@ namespace FirstPlugin Nodes.Add(SkeletonFolder); Nodes.Add(TextureFolder); - BMDFile = Model.Load(stream); - var skeleton = new STSkeleton(); - DrawableContainer.Drawables.Add(skeleton); - FillSkeleton(BMDFile.Scenegraph, skeleton, BMDFile.Joints.FlatSkeleton); + BMDFile = model; - foreach (var bone in skeleton.bones) + FillSkeleton(BMDFile.Scenegraph, Skeleton, BMDFile.Joints.FlatSkeleton); + + foreach (var bone in Skeleton.bones) { if (bone.Parent == null) SkeletonFolder.Nodes.Add(bone); @@ -140,7 +152,6 @@ namespace FirstPlugin var curShape = BMDFile.Shapes.Shapes[BMDFile.Shapes.RemapTable[i]]; var mat = new BMDMaterialWrapper(BMDFile.Materials.GetMaterial(i), BMDFile); - mat.Text = BMDFile.Materials.GetMaterialName(i); MaterialFolder.Nodes.Add(mat); var shpWrapper = new BMDShapeWrapper(curShape, BMDFile, mat); @@ -280,9 +291,35 @@ namespace FirstPlugin { List Items = new List(); Items.Add(new STToolStipMenuItem("Save", null, SaveAction, Keys.Control | Keys.S)); + Items.Add(new STToolStripSeparator()); + Items.Add(new STToolStipMenuItem("Export", null, ExportAction, Keys.Control | Keys.E)); + Items.Add(new STToolStipMenuItem("Replace", null, ReplaceAction, Keys.Control | Keys.R)); return Items.ToArray(); } + private void ExportAction(object sender, EventArgs args) + { + SaveFileDialog sfd = new SaveFileDialog(); + sfd.Filter = "Collada DAE |*.dae;"; + if (sfd.ShowDialog() == DialogResult.OK) + { + BMDFile.ExportAssImp(sfd.FileName, "dae", new ExportSettings()); + } + } + + private void ReplaceAction(object sender, EventArgs args) + { + OpenFileDialog ofd = new OpenFileDialog(); + ofd.Filter = "Collada DAE |*.dae;"; + if (ofd.ShowDialog() == DialogResult.OK) + { + Arguments arguments = new Arguments(); + arguments.input_path = ofd.FileName; + var model = Model.Load(arguments); + LoadBMD(model); + } + } + private void SaveAction(object sender, EventArgs args) { SaveFileDialog sfd = new SaveFileDialog(); diff --git a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache index 0710e34e..1d1d9d49 100644 Binary files a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache and b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache index 3eacc0b7..d212747d 100644 Binary files a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache and b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache differ diff --git a/Toolbox/Lib/Assimp32.dll b/Toolbox/Lib/Assimp32.dll new file mode 100644 index 00000000..ccb91217 Binary files /dev/null and b/Toolbox/Lib/Assimp32.dll differ diff --git a/Toolbox/Lib/Assimp64.dll b/Toolbox/Lib/Assimp64.dll new file mode 100644 index 00000000..cdaec66e Binary files /dev/null and b/Toolbox/Lib/Assimp64.dll differ diff --git a/Toolbox/Lib/SuperBMDLib.dll b/Toolbox/Lib/SuperBMDLib.dll index 33fced89..4c12d68e 100644 Binary files a/Toolbox/Lib/SuperBMDLib.dll and b/Toolbox/Lib/SuperBMDLib.dll differ diff --git a/Toolbox/Lib/SuperBMDLib.pdb b/Toolbox/Lib/SuperBMDLib.pdb index d6221dc6..1bc894e3 100644 Binary files a/Toolbox/Lib/SuperBMDLib.pdb and b/Toolbox/Lib/SuperBMDLib.pdb differ diff --git a/Toolbox/Toolbox.csproj b/Toolbox/Toolbox.csproj index edb56f6f..99ce68e7 100644 --- a/Toolbox/Toolbox.csproj +++ b/Toolbox/Toolbox.csproj @@ -301,9 +301,6 @@ - - PreserveNewest - PreserveNewest @@ -322,6 +319,12 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + PreserveNewest @@ -432,6 +435,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/Toolbox/assimp.dll b/Toolbox/assimp.dll deleted file mode 100644 index 1f8b10dd..00000000 Binary files a/Toolbox/assimp.dll and /dev/null differ