diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-01-27 20:27:05 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-01-27 20:27:05 +0300 |
commit | 117b36e1b5ade3d81dfacbb4da5377ca3aabc92d (patch) | |
tree | 72457c6ede593187570e430195785daccef6f4a7 /io_scene_gltf2 | |
parent | 5dba7a81397ac3b1d2a93be28a51165f8eaf3767 (diff) |
glTF importer: manage antipodal quaternion for node animation
Diffstat (limited to 'io_scene_gltf2')
-rwxr-xr-x | io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py | 6 |
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" |