Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather.py')
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather.py
index b3f4fd2a..6153bc33 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather.py
@@ -25,13 +25,14 @@ def gather_gltf2(export_settings):
animations = [] # unfortunately animations in gltf2 are just as 'root' as scenes.
active_scene = None
store_user_scene = bpy.context.scene
- for blender_scene in bpy.data.scenes:
+ scenes_to_export = bpy.data.scenes if export_settings['gltf_active_scene'] is False else [scene for scene in bpy.data.scenes if scene.name == store_user_scene.name]
+ for blender_scene in scenes_to_export:
scenes.append(__gather_scene(blender_scene, export_settings))
if export_settings[gltf2_blender_export_keys.ANIMATIONS]:
# resetting object cache
gltf2_blender_gather_animation_sampler_keyframes.get_object_matrix.reset_cache()
animations += __gather_animations(blender_scene, export_settings)
- if bpy.context.scene.name == blender_scene.name:
+ if bpy.context.scene.name == store_user_scene.name:
active_scene = len(scenes) -1
# restore user scene