Switch the default window to a new window


Appreciate your help on this, although simple I am having a challenge.

After I set up the default environment I want to then create a new window and then run the program again rendering a slightly different scene while keeping the first window.

I use:

win2 = base.openWindow(props = props, type = ‘onscreen’, keepCamera = False, makeCamera = True, requireWindow = True)

And then every time I render is rendering to both, win1 and win2

How can I ensure only win2 gets rendered without affecting what I already rendered in win1?

Thank you for your help.

I’m not entirely sure what you mean, how is the behaviour you are seeing with the code you gave different from what you expect?

You can create a new scene graph for your new camera to render by doing this:

render2 = NodePath("render2")
win2 = base.openWindow(..., scene=render2, ...)

Then, everything parented to render2 will show up in your newly created window.

Thank you!

it works