diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-08-29 08:26:53 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-08-29 08:26:53 +0300 |
commit | ea5f0df783b6476d04a872e17357600ae8134351 (patch) | |
tree | f391325a5ea321a12071fbc1e8abfd5d4a6b05df /io_scene_gltf2/blender/exp/gltf2_blender_gather.py | |
parent | fe627477c2501c1e38311c97b3b5e3ffa731947e (diff) |
glTF exporter: Set blender active scene as main scene in glTF file
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather.py')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather.py | 6 |
1 files changed, 4 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 013debdc..4d28a4bd 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather.py @@ -30,12 +30,14 @@ def gather_gltf2(export_settings): """ scenes = [] animations = [] # unfortunately animations in gltf2 are just as 'root' as scenes. + active_scene = None for blender_scene in bpy.data.scenes: scenes.append(__gather_scene(blender_scene, export_settings)) if export_settings[gltf2_blender_export_keys.ANIMATIONS]: animations += __gather_animations(blender_scene, export_settings) - - return scenes, animations + if bpy.context.scene.name == blender_scene.name: + active_scene = len(scenes) -1 + return active_scene, scenes, animations @cached |