diff --git a/.vs/Toolbox/v15/.suo b/.vs/Toolbox/v15/.suo index 3bb5ab6d..e609c34c 100644 Binary files a/.vs/Toolbox/v15/.suo and b/.vs/Toolbox/v15/.suo differ diff --git a/File_Format_Library/FileFormats/Archives/RARC.cs b/File_Format_Library/FileFormats/Archives/RARC.cs index ad650b38..a8c9f081 100644 --- a/File_Format_Library/FileFormats/Archives/RARC.cs +++ b/File_Format_Library/FileFormats/Archives/RARC.cs @@ -361,6 +361,9 @@ namespace FirstPlugin { writer.Write((uint)_exportStringTable.Count); } + + writer.Dispose(); + GC.SuppressFinalize(writer); } private void WriteDirectories() diff --git a/File_Format_Library/FileFormats/Texture/BFLIM.cs b/File_Format_Library/FileFormats/Texture/BFLIM.cs index cc7bd4ac..73b65e16 100644 --- a/File_Format_Library/FileFormats/Texture/BFLIM.cs +++ b/File_Format_Library/FileFormats/Texture/BFLIM.cs @@ -434,7 +434,6 @@ namespace FirstPlugin LoadComponents(Format); uint ImageSize = reader.ReadUInt32(); - Console.WriteLine(ImageSize); reader.Position = 0; ImageData = reader.ReadBytes((int)ImageSize); @@ -567,8 +566,6 @@ namespace FirstPlugin public override byte[] GetImageData(int ArrayLevel = 0, int MipLevel = 0) { - uint bpp = GetBytesPerPixel(Format); - if (image.Is3DS) { PlatformSwizzle = PlatformSwizzle.Platform_3DS; @@ -576,6 +573,8 @@ namespace FirstPlugin } else { + uint bpp = GetBytesPerPixel(Format); + GX2.GX2Surface surf = new GX2.GX2Surface(); surf.bpp = bpp; surf.height = image.Height; diff --git a/Switch_Toolbox_Library/FileFormats/Assimp/Assimp.cs b/Switch_Toolbox_Library/FileFormats/Assimp/Assimp.cs index 97a6584a..6897ad7a 100644 --- a/Switch_Toolbox_Library/FileFormats/Assimp/Assimp.cs +++ b/Switch_Toolbox_Library/FileFormats/Assimp/Assimp.cs @@ -497,7 +497,7 @@ namespace Toolbox.Library short SmoothIndex, short RigidIndex, bool IsRoot, ref Assimp.Matrix4x4 rootTransform) { Matrix4x4 trafo = node.Transform; - Matrix4x4 world = trafo * rootTransform; + Matrix4x4 world = trafo; var transformMat = AssimpHelper.TKMatrix(world); int matchedBoneIndex = skeleton.bones.FindIndex(item => item.Name == node.Name); @@ -508,6 +508,7 @@ namespace Toolbox.Library STBone bone = new STBone(); bone.skeletonParent = skeleton; + bone.RotationType = STBone.BoneRotationType.Euler; skeleton.bones.Add(bone); if (DaeHelper.IDMapToName.ContainsKey(node.Name)) @@ -545,11 +546,11 @@ namespace Toolbox.Library var rotation = transformMat.ExtractRotation(); var position = transformMat.ExtractTranslation(); - var rotEular = AssimpHelper.ToEular(rotation); + var rotEular = STMath.ToEulerAngles(rotation); bone.position = new float[] { position.X, position.Y, position.Z }; bone.scale = new float[] { scale.X, scale.Y, scale.Z }; - bone.rotation = new float[] { rotEular.X, rotEular.Y, rotEular.Z, 0 }; + bone.rotation = new float[] { rotEular.X, rotEular.Y, rotEular.Z, 1 }; } else { diff --git a/Switch_Toolbox_Library/FileFormats/Assimp/AssimpHelper.cs b/Switch_Toolbox_Library/FileFormats/Assimp/AssimpHelper.cs index 8b4180da..4f1dab8f 100644 --- a/Switch_Toolbox_Library/FileFormats/Assimp/AssimpHelper.cs +++ b/Switch_Toolbox_Library/FileFormats/Assimp/AssimpHelper.cs @@ -116,7 +116,8 @@ namespace Toolbox.Library input.A3, input.B3, input.C3, input.D3, input.A4, input.B4, input.C4, input.D4); } - public static Vector3 ToEular(OpenTK.Quaternion q) + + public static Vector3 ToEulerAngles(OpenTK.Quaternion q) { Matrix4 mat = Matrix4.CreateFromQuaternion(q); float x, y, z; diff --git a/Switch_Toolbox_Library/FileFormats/DAE/ColladaHelper.cs b/Switch_Toolbox_Library/FileFormats/DAE/ColladaHelper.cs index fe320104..634948ee 100644 --- a/Switch_Toolbox_Library/FileFormats/DAE/ColladaHelper.cs +++ b/Switch_Toolbox_Library/FileFormats/DAE/ColladaHelper.cs @@ -936,7 +936,7 @@ namespace ColladaHelper mat.ClearTranslation(); mat.Invert(); var quat = mat.ExtractRotation(); - rot = Toolbox.Library.AssimpHelper.ToEular(quat); + rot = Toolbox.Library.AssimpHelper.ToEulerAngles(quat); if (float.IsNaN(rot.X)) rot.X = 0; if (float.IsNaN(rot.Y)) rot.Y = 0; if (float.IsNaN(rot.Z)) rot.Z = 0; diff --git a/Switch_Toolbox_Library/Toolbox.Library.dll b/Switch_Toolbox_Library/Toolbox.Library.dll index 0c2a1a9f..1f46f414 100644 Binary files a/Switch_Toolbox_Library/Toolbox.Library.dll and b/Switch_Toolbox_Library/Toolbox.Library.dll differ diff --git a/Switch_Toolbox_Library/Toolbox.Library.pdb b/Switch_Toolbox_Library/Toolbox.Library.pdb index 5024fb58..65b380ce 100644 Binary files a/Switch_Toolbox_Library/Toolbox.Library.pdb and b/Switch_Toolbox_Library/Toolbox.Library.pdb differ