Fix for exporting animation on armature bones that have keys for a rotation_mode other than 'QUATERNION'. Thanks to Dmitry (MakKlaski) for highlighting this issue.

This commit is contained in:
Chris Foster 2015-04-14 23:04:39 -04:00
parent 1bd2e362fc
commit e66cdc9f40
Notes: blender-bot 2023-02-14 18:07:38 +01:00
Referenced by commit 524140ae: Revert "Fix for exporting animation on armature bones that have keys for a rotation_mode other than 'QUATERNION'.  Thanks to Dmitry (MakKlaski) for highlighting this issue."
Referenced by commit 524140ae, Revert "Fix for exporting animation on armature bones that have keys for a rotation_mode other than 'QUATERNION'.  Thanks to Dmitry (MakKlaski) for highlighting this issue."
1 changed files with 5 additions and 0 deletions

View File

@ -1144,10 +1144,15 @@ class ArmatureAnimationGenerator(GenericAnimationGenerator):
for Bone, BoneAnimation in \
zip(ArmatureObject.pose.bones, BoneAnimations):
RotationMode = Bone.rotation_mode
Bone.rotation_mode = 'QUATERNION'
Rotation = ArmatureObject.data.bones[Bone.name] \
.matrix.to_quaternion() * \
Bone.rotation_quaternion
Bone.rotation_mode = RotationMode
PoseMatrix = Matrix()
if Bone.parent:
PoseMatrix = Bone.parent.matrix.inverted()