diff --git a/MMDMotionCompute/Functions/GLTFUtil.cs b/MMDMotionCompute/Functions/GLTFUtil.cs index 0944615..c6927c6 100644 --- a/MMDMotionCompute/Functions/GLTFUtil.cs +++ b/MMDMotionCompute/Functions/GLTFUtil.cs @@ -199,7 +199,7 @@ void _reset() foreach (var bone in character.bones) { - boneKeyFrames[bone.Name].Add(new BoneKeyFrame { Frame = t, Translation = bone.dynamicPosition, Rotation = bone.rotation }); + boneKeyFrames[bone.Name].Add(new BoneKeyFrame { Frame = t, Translation = bone.dynamicPosition, Rotation = bone.finalRotation }); } } float[] min; diff --git a/MMDMotionCompute/MMD/MMDCharacter.cs b/MMDMotionCompute/MMD/MMDCharacter.cs index 6e13bb2..f36d850 100644 --- a/MMDMotionCompute/MMD/MMDCharacter.cs +++ b/MMDMotionCompute/MMD/MMDCharacter.cs @@ -151,7 +151,6 @@ public void BakeSequenceProcessMatrixsIndex() continue; var parent = bones[bones[i].ParentIndex]; bonesTest[i] |= bonesTest[bones[i].ParentIndex]; - bonesTest[i] |= parent.IsPhysicsFreeBone; if (bonesTest[i]) { PhysicsNeedUpdateMatIndexs.Add(i); @@ -402,7 +401,6 @@ public static MMDCharacter Load(PMXFormat pmx) Name = _bone.Name, Flags = _bone.Flags, NameEN = _bone.NameEN, - }; if (bone.Flags.HasFlag(PMX_BoneFlag.HasIK)) @@ -473,6 +471,7 @@ public class Bone public Vector3 appendTranslation; public Quaternion appendRotation = Quaternion.Identity; public int index; + public Quaternion finalRotation { get => rotation * appendRotation; } public int CCDIterateLimit = 0; public float CCDAngleLimit = 0; @@ -484,7 +483,6 @@ public class Bone public string NameEN; public bool IsAppendRotation; public bool IsAppendTranslation; - public bool IsPhysicsFreeBone; public PMX_BoneFlag Flags; public IKLink[] boneIKLinks; public float AppendRatio;