diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index 37c126e7..1caab310 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 d310c5be..2f82ee26 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 e5e05a45..2e84c586 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/BfresSwitch.cs b/Switch_FileFormatsMain/FileFormats/BFRES/BfresSwitch.cs index 09bb98ec..fa3a97ed 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/BfresSwitch.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/BfresSwitch.cs @@ -334,7 +334,13 @@ namespace FirstPlugin } if (fshp.VertexSkinCount == 0) { - Matrix4 NoBindFix = model.Skeleton.bones[fshp.BoneIndex].Transform; + int boneIndex = fshp.BoneIndex; + + //Not often but some models use a bone index list instead + if (fshp.BoneIndices.Count > 0) + boneIndex = fshp.BoneIndices[0]; + + Matrix4 NoBindFix = model.Skeleton.bones[boneIndex].Transform; v.pos = Vector3.TransformPosition(v.pos, NoBindFix); v.nrm = Vector3.TransformNormal(v.nrm, NoBindFix); } diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/BfresWiiU.cs b/Switch_FileFormatsMain/FileFormats/BFRES/BfresWiiU.cs index ef79bd64..a5df34e3 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/BfresWiiU.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/BfresWiiU.cs @@ -287,7 +287,13 @@ namespace FirstPlugin try { if (model.Skeleton.bones.Count > 0) { - Matrix4 NoBindFix = model.Skeleton.bones[fshp.BoneIndex].Transform; + int boneIndex = fshp.BoneIndex; + + //Not often but some models use a bone index list instead + if (fshp.BoneIndices.Count > 0) + boneIndex = fshp.BoneIndices[0]; + + Matrix4 NoBindFix = model.Skeleton.bones[boneIndex].Transform; v.pos = Vector3.TransformPosition(v.pos, NoBindFix); v.nrm = Vector3.TransformNormal(v.nrm, NoBindFix); } diff --git a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache index bdae2fe5..13069f02 100644 Binary files a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache and b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache differ