More bone transform fixes
This commit is contained in:
parent
c86a7b23ca
commit
74dc1c132c
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -334,7 +334,13 @@ namespace FirstPlugin
|
|||||||
}
|
}
|
||||||
if (fshp.VertexSkinCount == 0)
|
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.pos = Vector3.TransformPosition(v.pos, NoBindFix);
|
||||||
v.nrm = Vector3.TransformNormal(v.nrm, NoBindFix);
|
v.nrm = Vector3.TransformNormal(v.nrm, NoBindFix);
|
||||||
}
|
}
|
||||||
|
@ -287,7 +287,13 @@ namespace FirstPlugin
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (model.Skeleton.bones.Count > 0) {
|
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.pos = Vector3.TransformPosition(v.pos, NoBindFix);
|
||||||
v.nrm = Vector3.TransformNormal(v.nrm, NoBindFix);
|
v.nrm = Vector3.TransformNormal(v.nrm, NoBindFix);
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user