diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-06-05 07:52:58 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-06-05 07:52:58 +0300 |
commit | a84dac69bc9d0b78b1cadd12a39cacc16a4eabe3 (patch) | |
tree | 6c446580e86de3e24f602f4f7a7d0912d4edd3ec /io_scene_gltf2/blender | |
parent | 91f9d211df3712307abb6402de63349dc2c88451 (diff) |
glTF exporter: fix bezier interpolation export
Diffstat (limited to 'io_scene_gltf2/blender')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py index 8c01a940..16346729 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py @@ -296,7 +296,10 @@ def __gather_output(channels: typing.Tuple[bpy.types.FCurve], if is_yup and blender_object_if_armature is None: in_tangent = gltf2_blender_math.swizzle_yup(in_tangent, target_datapath) # the tangent in glTF is relative to the keyframe value - in_tangent = value - in_tangent if not isinstance(value, list) else [value[0] - in_tangent[0]] + if not isinstance(value, list): + in_tangent = value - in_tangent + else: + in_tangent = [value[i] - in_tangent[i] for i in range(len(value))] keyframe_value = gltf2_blender_math.mathutils_to_gltf(in_tangent) + keyframe_value # append if keyframe.out_tangent is not None: @@ -305,7 +308,10 @@ def __gather_output(channels: typing.Tuple[bpy.types.FCurve], if is_yup and blender_object_if_armature is None: out_tangent = gltf2_blender_math.swizzle_yup(out_tangent, target_datapath) # the tangent in glTF is relative to the keyframe value - out_tangent = value - out_tangent if not isinstance(value, list) else [value[0] - out_tangent[0]] + if not isinstance(value, list): + out_tangent = value - out_tangent + else: + out_tangent = [value[i] - out_tangent[i] for i in range(len(value))] keyframe_value = keyframe_value + gltf2_blender_math.mathutils_to_gltf(out_tangent) # append values += keyframe_value |