diff --git a/File_Format_Library/FileFormats/NLG/MarioStrikers/StrikersRLG.cs b/File_Format_Library/FileFormats/NLG/MarioStrikers/StrikersRLG.cs index 8129877a..0f0333f0 100644 --- a/File_Format_Library/FileFormats/NLG/MarioStrikers/StrikersRLG.cs +++ b/File_Format_Library/FileFormats/NLG/MarioStrikers/StrikersRLG.cs @@ -123,7 +123,11 @@ namespace FirstPlugin.NLG model.Materials = Materials; model.Objects = Renderer.Meshes; - DAE.Export(fileName, settings, model, textures); + STSkeleton skeleton = null; + if (DrawableContainer.Drawables.Count > 1) + skeleton = (STSkeleton)DrawableContainer.Drawables[1]; + + DAE.Export(fileName, settings, model, textures, skeleton); } public enum SectionMagic : uint diff --git a/Switch_Toolbox_Library/FileFormats/DAE/ColladaWriter.cs b/Switch_Toolbox_Library/FileFormats/DAE/ColladaWriter.cs index 78886f87..120b3a13 100644 --- a/Switch_Toolbox_Library/FileFormats/DAE/ColladaWriter.cs +++ b/Switch_Toolbox_Library/FileFormats/DAE/ColladaWriter.cs @@ -486,7 +486,8 @@ namespace Toolbox.Library.Collada { Writer.WriteEndElement(); - CreateControllerSection(); + if (Joints?.Count > 0) + CreateControllerSection(); CreateVisualNodeSection(); } @@ -611,6 +612,7 @@ namespace Toolbox.Library.Collada InvBinds[i * 16 + j] = meshJoints[i].BindPose[j]; } } + var Weights = new List(); var WeightIndices = new List(); foreach (var v in BoneWeight.Item2) diff --git a/Switch_Toolbox_Library/FileFormats/DAE/DAE.cs b/Switch_Toolbox_Library/FileFormats/DAE/DAE.cs index 34461581..2a9de454 100644 --- a/Switch_Toolbox_Library/FileFormats/DAE/DAE.cs +++ b/Switch_Toolbox_Library/FileFormats/DAE/DAE.cs @@ -11,6 +11,7 @@ using System.Xml; using OpenTK; using Toolbox.Library.Rendering; using Toolbox.Library.Collada; +using Toolbox.Library.IO; namespace Toolbox.Library { @@ -84,7 +85,22 @@ namespace Toolbox.Library if (settings.ExportTextures) { var bitmap = Textures[i].GetBitmap(); - bitmap.Save($"{TexturePath}/{Textures[i].Text}.png"); + + string textureName = Textures[i].Text; + if (textureName.RemoveIllegaleFileNameCharacters() != textureName) + { + string properName = textureName.RemoveIllegaleFileNameCharacters(); + for (int m = 0; m < Materials?.Count; m++) { + foreach (var tex in Materials[m].TextureMaps) { + if (tex.Name == textureName) + tex.Name = properName; + } + } + + textureName = properName; + } + + bitmap.Save($"{TexturePath}/{textureName}.png"); bitmap.Dispose(); GC.Collect();