[Bf-extensions-cvs] [b1cc242c] master: glTF exporter: STEP interpolation if there is only 1 keyframe
Julien Duroure
noreply at git.blender.org
Mon Apr 15 16:45:43 CEST 2019
Commit: b1cc242cfd7d63efc77392762346d4768ce667ba
Author: Julien Duroure
Date: Mon Apr 15 16:39:17 2019 +0200
Branches: master
https://developer.blender.org/rBAb1cc242cfd7d63efc77392762346d4768ce667ba
glTF exporter: STEP interpolation if there is only 1 keyframe
===================================================================
M io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py
===================================================================
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]
More information about the Bf-extensions-cvs
mailing list