]> git.tdb.fi Git - libs/gl.git/commitdiff
Export all cameras for scenes
authorMikko Rasa <tdb@tdb.fi>
Tue, 30 Jul 2024 15:27:12 +0000 (18:27 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 30 Jul 2024 15:27:12 +0000 (18:27 +0300)
blender/io_mspgl/export.py
blender/io_mspgl/scene.py

index e065a3f2f4ba56c98f8a5aee14484d1782be5f24..d7dc3b21c97eac433f55c2f71d861085028294ca 100644 (file)
@@ -128,8 +128,7 @@ class ProjectExporter:
                for s in scenes.values():
                        all_objects += [p.object for p in s.prototypes]
                        all_objects += s.lights
-                       if s.camera:
-                               all_objects.append(s.camera)
+                       all_objects += s.cameras
 
                ordered_scenes = []
                while scene_queue:
index 8aa1840aacced21f932d0edec1a5666371a1c920..f94779073c9e77f17a60de286599387fdbca39d1 100644 (file)
@@ -34,7 +34,7 @@ class Scene:
                self.name = scene.name
                self.export_disposition = scene.export_disposition
                self.background_set = None
-               self.camera = scene.camera
+               self.cameras = [scene.camera]
                self.prototypes = []
                self.instances = []
                self.blended_instances = []
@@ -79,6 +79,8 @@ class Scene:
                                self.lights.append(o)
                                if o.data.use_shadow:
                                        self.use_shadow = True
+                       elif o.type=='CAMERA' and o!=scene.camera:
+                               self.cameras.append(o)
 
                for i in scene.view_layers[0].depsgraph.object_instances:
                        if i.is_instance and i.object.type=='MESH':