[Bf-extensions-cvs] [4579db10] master: glTF exporter: export animation only if corresponding object is exported

Julien Duroure noreply at git.blender.org
Thu Jun 13 23:49:36 CEST 2019


Commit: 4579db103294ac8b6b81549c6b9cfc91b37e5847
Author: Julien Duroure
Date:   Thu Jun 13 23:29:09 2019 +0200
Branches: master
https://developer.blender.org/rBA4579db103294ac8b6b81549c6b9cfc91b37e5847

glTF exporter: export animation only if corresponding object is exported

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

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

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

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 32f642ff..afd1d7ad 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, 26),
+    "version": (0, 9, 27),
     '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.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather.py
index 3fa697fc..63254899 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather.py
@@ -59,7 +59,10 @@ def __gather_scene(blender_scene, export_settings):
 def __gather_animations(blender_scene, export_settings):
     animations = []
     for blender_object in blender_scene.objects:
-        animations += gltf2_blender_gather_animations.gather_animations(blender_object, export_settings)
+        # First check if this object is exported or not. Do not export animation of not exported object
+        obj_node = gltf2_blender_gather_nodes.gather_node(blender_object, export_settings)
+        if obj_node is not None:
+            animations += gltf2_blender_gather_animations.gather_animations(blender_object, export_settings)
     return animations



More information about the Bf-extensions-cvs mailing list