Open xzhuah opened 2 years ago
I did some debugging, my finding is that: in the vmd/importer.py
For the BoneConverter.convert_rotation:
rot = Quaternion() rot.x, rot.y, rot.z, rot.w = rotation_xyzw return Quaternion(matmul(self.__mat, rot.axis) * -1, rot.angle).normalized()
I don't quite understand why we need to do that matmul calucation there. But if we return rot directly, the bone rotation of my above example would become visually correct. However, other bones would go wrong. So I guess, in some cases, we don't need to do that calcuation?
I also noticed that the error bone rotation typically happens when the rotation value change dramatically: like in the following diragram, it happen at those troughs.
I noticed that importing the same VMD file into Blender and MMD, results in slightly different pose at some key frames.
I spent some time investigating what happened and I wrote a little python script to decde the VMD file and read the Quaternion value. Now I saw the problem: when imported to the blender, the Quaternion value changed for some reason. The Quaternion value being used in blender is different from what is in the VMD file. When I manually correct the Quaternion value in blender, the pose restore to normal
.
Could you please double check the VMD file loader to see why this happen?