Hello, I’m new to UPBGE (but not to Blender and python scripting).
In my project I need to start with an empty scene and populate it from scratch at runtime via python script. My scene will contain possibly multiple cameras, and I need to switch between them at runtime.
So the question is: is it possible to have multiple cameras in the scene and set which one isused for rendering?
Alternatively, is it possible to have more cameras “activated” and modify the rendering viewport of each one to have views from multiple cameras at the same time on screen?
I will be deploying the result as a standalone executable.
EDIT: i’m using UPBGE v0.3.0 since I need EEVEE support
Tested on legacy 2.7x but it should be similar on the new API.
from bge.logic import getCurrentController
own = getCurrentController().owner
scene = own.scene
scene.active_camera = scene.objects["Camera.001"]
You may want too keep a list of object references to different cameras to avoid having to look them up by name. Managing such a list is eh, bit of another topic.
Thanks, I tested this as well and works as expected. However after testing both this and the scene.active_camera flag I think i will proceed with the other method