diff options
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py | 11 |
1 files changed, 6 insertions, 5 deletions
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 cf106c41..05615053 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py @@ -214,9 +214,10 @@ def __get_blender_actions(blender_object: bpy.types.Object, for track in blender_object.animation_data.nla_tracks: # Multi-strip tracks do not export correctly yet (they need to be baked), # so skip them for now and only write single-strip tracks. - if track.strips is None or len(track.strips) != 1: + non_muted_strips = [strip for strip in track.strips if strip.action is not None and strip.mute is False] + if track.strips is None or len(non_muted_strips) != 1: continue - for strip in [strip for strip in track.strips if strip.action is not None]: + for strip in non_muted_strips: blender_actions.append(strip.action) blender_tracks[strip.action.name] = track.name # Always set after possible active action -> None will be overwrite @@ -233,9 +234,10 @@ def __get_blender_actions(blender_object: bpy.types.Object, for track in blender_object.data.shape_keys.animation_data.nla_tracks: # Multi-strip tracks do not export correctly yet (they need to be baked), # so skip them for now and only write single-strip tracks. - if track.strips is None or len(track.strips) != 1: + non_muted_strips = [strip for strip in track.strips if strip.action is not None and strip.mute is False] + if track.strips is None or len(non_muted_strips) != 1: continue - for strip in track.strips: + for strip in non_muted_strips: blender_actions.append(strip.action) blender_tracks[strip.action.name] = track.name # Always set after possible active action -> None will be overwrite @@ -245,4 +247,3 @@ def __get_blender_actions(blender_object: bpy.types.Object, blender_actions.sort(key = lambda a: a.name.lower()) return [(blender_action, blender_tracks[blender_action.name]) for blender_action in blender_actions] - |