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:
authorJulien Duroure <julien.duroure@gmail.com>2019-01-27 20:27:05 +0300
committerJulien Duroure <julien.duroure@gmail.com>2019-01-27 20:27:05 +0300
commit117b36e1b5ade3d81dfacbb4da5377ca3aabc92d (patch)
tree72457c6ede593187570e430195785daccef6f4a7
parent5dba7a81397ac3b1d2a93be28a51165f8eaf3767 (diff)
glTF importer: manage antipodal quaternion for node animation
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_animation_node.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py b/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py
index 6a79ac67..0d36fb50 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py
@@ -98,6 +98,12 @@ class BlenderNodeAnim():
else:
values = [quaternion_gltf_to_blender(vals) for vals in values]
+
+ # Manage antipodal quaternions
+ for i in range(1, len(values)):
+ if values[i].dot(values[i-1]) < 0:
+ values[i] = -values[i]
+
elif channel.target.path == "scale":
blender_path = "scale"
group_name = "scale"