diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-04-15 17:39:17 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-04-15 17:39:17 +0300 |
commit | b1cc242cfd7d63efc77392762346d4768ce667ba (patch) | |
tree | c6dfaf5cc47b11104c95244fcaf7295c094865a1 | |
parent | 167810169ee8c83ed6d8f093e1d78105a28de8cb (diff) |
glTF exporter: STEP interpolation if there is only 1 keyframe
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py | 4 |
1 files changed, 3 insertions, 1 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 4fedd469..dc3b6d30 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 @@ -89,7 +89,9 @@ def __gather_interpolation(channels: typing.Tuple[bpy.types.FCurve], if gltf2_blender_gather_animation_sampler_keyframes.needs_baking(blender_object_if_armature, channels, export_settings): - return 'STEP' + max_keyframes = max([len(ch.keyframe_points) for ch in channels]) + # If only single keyframe revert to STEP + return 'STEP' if max_keyframes < 2 else 'LINEAR' blender_keyframe = channels[0].keyframe_points[0] |