mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 20:43:09 +00:00
More bone transform fixes
This commit is contained in:
parent
c86a7b23ca
commit
74dc1c132c
6 changed files with 14 additions and 2 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue