From 3a292a1f1c68f2ec558f36fe0b815236e2562301 Mon Sep 17 00:00:00 2001 From: Julien Duroure Date: Fri, 15 Sep 2023 17:02:17 +0200 Subject: [PATCH] Single Armature with no animation data will not export all anims --- .../blender/exp/animation/gltf2_blender_gather_action.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_action.py b/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_action.py index ad8c7d872..77d181fcb 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_action.py +++ b/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_action.py @@ -480,8 +480,10 @@ def __get_blender_actions(obj_uuid: str, action_on_type[strip.action.name] = "SHAPEKEY" # If there are only 1 armature, include all animations, even if not in NLA + # But only if armature has already some animation_data + # If not, we says that this armature is never animated, so don't add these additional actions if export_settings['gltf_export_anim_single_armature'] is True: - if blender_object.type == "ARMATURE": + if blender_object.type == "ARMATURE" and blender_object.animation_data is not None: if len(export_settings['vtree'].get_all_node_of_type(VExportNode.ARMATURE)) == 1: # Keep all actions on objects (no Shapekey animation) for act in [a for a in bpy.data.actions if a.id_root == "OBJECT"]: