diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index 636b7c50..32ea4b89 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 179aee8b..71cc9678 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 28d4f648..7a6c2f34 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/BFRES/BfresWiiU.cs b/Switch_FileFormatsMain/FileFormats/BFRES/BfresWiiU.cs index 01677ff9..531ec134 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/BfresWiiU.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/BfresWiiU.cs @@ -58,7 +58,6 @@ namespace FirstPlugin List RigidIndices = new List(); ushort SmoothIndex = 0; - ushort RigidIndex = 0; ushort BoneIndex = 0; foreach (BfresBone bn in fmdl.Skeleton.bones) @@ -66,12 +65,6 @@ namespace FirstPlugin if (model.Skeleton.Bones.ContainsKey(bn.Text)) { var Bone = model.Skeleton.Bones[bn.Text]; - if (bn.UseRigidMatrix || bn.RigidMatrixIndex != -1) - { - bn.RigidMatrixIndex = (short)RigidIndex++; - Bone.RigidMatrixIndex = bn.RigidMatrixIndex; - RigidIndices.Add(BoneIndex); - } if (bn.UseSmoothMatrix || bn.SmoothMatrixIndex != -1) { bn.SmoothMatrixIndex = (short)SmoothIndex++; @@ -85,8 +78,21 @@ namespace FirstPlugin } } - //Rigid indices at the end - var AllIndices = SmoothIndices.Concat(RigidIndices).ToList(); + //Rigid Indices come after smooth indices. Start from the last smooth index + ushort RigidIndex = (ushort)(SmoothIndices.Count); + foreach (BfresBone bn in fmdl.Skeleton.bones) + { + var Bone = model.Skeleton.Bones[bn.Text]; + if (bn.UseRigidMatrix || bn.RigidMatrixIndex != -1) + { + bn.RigidMatrixIndex = (short)RigidIndex++; + Bone.RigidMatrixIndex = bn.RigidMatrixIndex; + RigidIndices.Add(BoneIndex); + } + } + + //Rigid indices at the end + var AllIndices = SmoothIndices.Concat(RigidIndices).ToList(); model.Skeleton.MatrixToBoneList = AllIndices.ToArray(); model.Skeleton.InverseModelMatrices = SmoothMatrices; diff --git a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache index 9352da7e..27dcacfe 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 ad9fdecf..ef11093b 100644 Binary files a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache and b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache differ