diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-04-14 09:40:31 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-04-14 09:40:31 +0300 |
commit | 5fdd91c09edf7c5a4794a3de4fbb1a7603d609f0 (patch) | |
tree | 59cbf599b09129a36600340068294815e3ac0aa1 | |
parent | 30981df003d2ca46d93692270cdbcc00addbf02f (diff) |
glTF importer: Fix handle tangent when BEZIER interpolation
Note that tangents are not managed from gltf file yet, but now handle AUTO are correct
-rwxr-xr-x | io_scene_gltf2/blender/imp/gltf2_blender_animation_bone.py | 3 | ||||
-rwxr-xr-x | io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_animation_bone.py b/io_scene_gltf2/blender/imp/gltf2_blender_animation_bone.py index c568db22..f5fbd7b9 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_animation_bone.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_animation_bone.py @@ -34,6 +34,8 @@ class BlenderBoneAnim(): kf.interpolation = 'CONSTANT' elif interpolation == "CUBICSPLINE": kf.interpolation = 'BEZIER' + kf.handle_right_type = 'AUTO' + kf.handle_left_type = 'AUTO' else: kf.interpolation = 'LINEAR' @@ -205,6 +207,7 @@ class BlenderBoneAnim(): # Setting interpolation for kf in fcurve.keyframe_points: BlenderBoneAnim.set_interpolation(interpolation, kf) + fcurve.update() # force updating tangents (this may change when tangent will be managed) @staticmethod def anim(gltf, anim_idx, node_idx): 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 0be98a06..4cb66299 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py @@ -34,6 +34,8 @@ class BlenderNodeAnim(): kf.interpolation = 'CONSTANT' elif interpolation == "CUBICSPLINE": kf.interpolation = 'BEZIER' + kf.handle_right_type = 'AUTO' + kf.handle_left_type = 'AUTO' else: kf.interpolation = 'LINEAR' @@ -128,6 +130,7 @@ class BlenderNodeAnim(): # Setting interpolation for kf in fcurve.keyframe_points: BlenderNodeAnim.set_interpolation(animation.samplers[channel.sampler].interpolation, kf) + fcurve.update() # force updating tangents (this may change when tangent will be managed) elif channel.target.path == 'weights': |