[Bf-extensions-cvs] [22424950] master: glTF exporter: Don't take mute strip into account

Julien Duroure noreply at git.blender.org
Sat Feb 22 08:18:40 CET 2020


Commit: 22424950a3f61d81070fc0edf3773e7c4a4a1184
Author: Julien Duroure
Date:   Sat Feb 22 08:18:21 2020 +0100
Branches: master
https://developer.blender.org/rBA22424950a3f61d81070fc0edf3773e7c4a4a1184

glTF exporter: Don't take mute strip into account

===================================================================

M	io_scene_gltf2/__init__.py
M	io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py

===================================================================

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 2efef1d9..78ba283c 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -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',
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 c78c8065..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



More information about the Bf-extensions-cvs mailing list