Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Foster <cdbfoster@gmail.com>2015-04-15 06:04:39 +0300
committerChris Foster <cdbfoster@gmail.com>2015-04-15 06:04:39 +0300
commite66cdc9f40ef48fab506e801ec1e313db2487e0a (patch)
treed1739ab8d57ae3b7dc9c830c9cd23283ce4b9b65
parent1bd2e362fc81fcd0194c07b6305e1a359e5a5cdb (diff)
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.
-rw-r--r--io_scene_x/export_x.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/io_scene_x/export_x.py b/io_scene_x/export_x.py
index fb17106e..345d14ab 100644
--- a/io_scene_x/export_x.py
+++ b/io_scene_x/export_x.py
@@ -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()