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-03-16 17:55:13 +0300
committerJulien Duroure <julien.duroure@gmail.com>2019-03-16 17:55:13 +0300
commit41699ae84a7d1f29f4938752c24e61da6c101aa5 (patch)
treefc3556ea595e09cc2f72a2d5361a259a1807b0b5 /io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py
parentd3dd36adfe100c6b687e88d87e1777baf98396e3 (diff)
glTF exporter: Bake animation when targeting a quaternion with bezier interpolation
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py')
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py
index 351a036a..4ec68c88 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py
@@ -160,10 +160,11 @@ def needs_baking(channels: typing.Tuple[bpy.types.FCurve],
def all_equal(lst):
return lst[1:] == lst[:-1]
-
+ # Sampling is forced
if export_settings[gltf2_blender_export_keys.FORCE_SAMPLING]:
return True
+ # Sampling due to unsupported interpolation
interpolation = channels[0].keyframe_points[0].interpolation
if interpolation not in ["BEZIER", "LINEAR", "CONSTANT"]:
gltf2_io_debug.print_console("WARNING",
@@ -175,7 +176,7 @@ def needs_baking(channels: typing.Tuple[bpy.types.FCurve],
if any(any(k.interpolation != interpolation for k in c.keyframe_points) for c in channels):
# There are different interpolation methods in one action group
gltf2_io_debug.print_console("WARNING",
- "Baking animation because there are different "
+ "Baking animation because there are keyframes with different "
"interpolation methods in one channel"
)
return True
@@ -196,5 +197,11 @@ def needs_baking(channels: typing.Tuple[bpy.types.FCurve],
"Baking animation because of differently located keyframes in one channel")
return True
+ # Baking is required when the animation targets a quaternion with bezier interpolation
+ if channels[0].data_path == "rotation_quaternion" and interpolation == "BEZIER":
+ gltf2_io_debug.print_console("WARNING",
+ "Baking animation because targeting a quaternion with bezier interpolation")
+ return True
+
return False