glTF exporter: Don't take mute strip into account

This commit is contained in:
Julien Duroure 2020-02-22 08:18:21 +01:00
parent b629ab427c
commit 22424950a3
2 changed files with 7 additions and 5 deletions

View File

@ -15,7 +15,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (1, 2, 23),
"version": (1, 2, 24),
'blender': (2, 82, 7),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@ -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