[Bf-extensions-cvs] [7f732e37] master: glTF exporter: take into account NLA tracks for shapekeys animation

Julien Duroure noreply at git.blender.org
Mon Aug 5 19:16:58 CEST 2019


Commit: 7f732e373a236a12f3c6c694abf44006a4efa4f1
Author: Julien Duroure
Date:   Mon Aug 5 19:16:16 2019 +0200
Branches: master
https://developer.blender.org/rBA7f732e373a236a12f3c6c694abf44006a4efa4f1

glTF exporter: take into account NLA tracks for shapekeys animation

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

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 89de2079..7f49cc4c 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": (0, 9, 42),
+    "version": (0, 9, 43),
     'blender': (2, 80, 0),
     '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 7a4f1213..4a65bcd9 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py
@@ -193,9 +193,18 @@ def __get_blender_actions(blender_object: bpy.types.Object
     if blender_object.type == "MESH" \
             and blender_object.data is not None \
             and blender_object.data.shape_keys is not None \
-            and blender_object.data.shape_keys.animation_data is not None \
-            and blender_object.data.shape_keys.animation_data.action is not None:
-        blender_actions.append(blender_object.data.shape_keys.animation_data.action)
+            and blender_object.data.shape_keys.animation_data is not None:
+
+            if blender_object.data.shape_keys.animation_data.action is not None:
+                blender_actions.append(blender_object.data.shape_keys.animation_data.action)
+
+            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:
+                    continue
+                for strip in track.strips:
+                    blender_actions.append(strip.action)
 
     # Remove duplicate actions.
     blender_actions = list(set(blender_actions))



More information about the Bf-extensions-cvs mailing list