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-04-15 17:39:17 +0300
committerJulien Duroure <julien.duroure@gmail.com>2019-04-15 17:39:17 +0300
commitb1cc242cfd7d63efc77392762346d4768ce667ba (patch)
treec6dfaf5cc47b11104c95244fcaf7295c094865a1 /io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py
parent167810169ee8c83ed6d8f093e1d78105a28de8cb (diff)
glTF exporter: STEP interpolation if there is only 1 keyframe
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py')
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py4
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]