glTF exporter: export animation only if corresponding object is exported

This commit is contained in:
Julien Duroure 2019-06-13 23:29:09 +02:00
parent 139166de51
commit 4579db1032
2 changed files with 5 additions and 2 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": (0, 9, 26),
"version": (0, 9, 27),
'blender': (2, 80, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

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