From a8c700d4ebe6a1a767758a0b79775d48d7fbe085 Mon Sep 17 00:00:00 2001 From: Julien Duroure Date: Mon, 23 Aug 2021 22:24:15 +0200 Subject: glTF exporter: fix animation export when no channels are valid --- .../blender/exp/gltf2_blender_gather_animation_channels.py | 3 ++- io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'io_scene_gltf2/blender') diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py index 6c184198..3046a1ce 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py @@ -118,7 +118,8 @@ def gather_animation_channels(blender_action: bpy.types.Action, blender_action.name, obj, False) - channels.append(channel) + if channel is not None: + channels.append(channel) else: for channel_group in __get_channel_groups(blender_action, blender_object, export_settings): diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py index 06e6860c..819c8085 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py @@ -121,12 +121,12 @@ def __gather_animation(blender_action: bpy.types.Action, print_console("WARNING", "Animation '{}' could not be exported. Cause: {}".format(name, error)) return None - # To allow reuse of samplers in one animation, - __link_samplers(animation, export_settings) - if not animation.channels: return None + # To allow reuse of samplers in one animation, + __link_samplers(animation, export_settings) + export_user_extensions('gather_animation_hook', export_settings, animation, blender_action, blender_object) return animation -- cgit v1.2.3