[Bf-extensions-cvs] [24cc252d] master: glTF exporter: animation get removed when using both TRS + SK animation

Julien Duroure noreply at git.blender.org
Sun Dec 29 13:13:43 CET 2019


Commit: 24cc252dc6f69edac3d811085253f7cbae690085
Author: Julien Duroure
Date:   Sun Dec 29 13:09:08 2019 +0100
Branches: master
https://developer.blender.org/rBA24cc252dc6f69edac3d811085253f7cbae690085

glTF exporter: animation get removed when using both TRS + SK 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 78141088..1b581b8c 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, 1, 27),
+    "version": (1, 1, 28),
     'blender': (2, 81, 6),
     '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 bf78dabd..f959ce14 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py
@@ -48,7 +48,7 @@ def gather_animations(blender_object: bpy.types.Object,
     for blender_action, track_name in blender_actions:
 
         # Set action as active, to be able to bake if needed
-        if blender_object.animation_data: # Not for shapekeys!
+        if blender_action.id_root == "OBJECT" and blender_object.animation_data: # Not for shapekeys!
             if blender_object.animation_data.action is None \
                     or (blender_object.animation_data.action.name != blender_action.name):
                 if blender_object.animation_data.is_property_readonly('action'):
@@ -63,6 +63,8 @@ def gather_animations(blender_object: bpy.types.Object,
                     print_console("WARNING", "Animation '{}' could not be exported. Cause: {}".format(blender_action.name, error))
                     continue
 
+        # No need to set active shapekeys animations, this is needed for bone baking
+
         animation = __gather_animation(blender_action, blender_object, export_settings)
         if animation is not None:
             animations.append(animation)



More information about the Bf-extensions-cvs mailing list