From: Mikko Rasa Date: Tue, 30 Jul 2024 15:27:12 +0000 (+0300) Subject: Export all cameras for scenes X-Git-Url: https://git.tdb.fi/?a=commitdiff_plain;h=52ae6b511db79057872752a7dda6047d58a9dec2;p=libs%2Fgl.git Export all cameras for scenes --- diff --git a/blender/io_mspgl/export.py b/blender/io_mspgl/export.py index e065a3f2..d7dc3b21 100644 --- a/blender/io_mspgl/export.py +++ b/blender/io_mspgl/export.py @@ -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: diff --git a/blender/io_mspgl/scene.py b/blender/io_mspgl/scene.py index 8aa1840a..f9477907 100644 --- a/blender/io_mspgl/scene.py +++ b/blender/io_mspgl/scene.py @@ -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':