Cleaning base.win

Hello,

Is there anyway to clean base.win (removing all the procedural geometry and 2D text objects) before or after processing a sequence of renditions so they don’t overlap?

Thank you in advance

Hmm, could you elaborate on what you mean? Do you want Panda to clear the window between rendering one group of objects and rendering another? If so, this would usually be done by creating a second DisplayRegion and setting a clear color/depth on it.

Thank you,

It seems that the following code is not working for me, every time I want to clear/wipe out what has been rendered:


        region = base.win.getDisplayRegion(0)
        region.setActive(False)

        region = base.win.makeDisplayRegion()
        cam=base.makeCamera(base.win)

        region.setClearColor(VBase4(1,1,1,1))
        region.setClearColorActive(True)
        region.setClearDepthActive(True)

I just need to discard what has been rendered and start anew

Thank you

I’m still not sure what you mean. If you mean to erase the objects that are in the scene, you can call base.render.getChildren().detach().

Note that it’s display region 1 that contains the main scene, not 0.