Is there any way to set an entire scene transparent?

Ok so I know I can set a frame that is displaying a scene through a render2d frame completely transparent with a setAlphaScale lerp interval on the nodepath of the card.

Can I do the same with the default camera nodepath?

Something like:


cameraFadeOut = LerpFunctionInterval(camera.setAlphaScale, toData = 0.0, fromData = 1.0, duration = 1.0)

is camera is right nodePath to call for this interval, or is this not possible?
maybe base.camNode?

you could set the transparency and alpha on render (or some other scene root that you have).

I think you could do that for camera but I think it could create problems later.

Perhaps you should create a new nodepath and then parent all your cards to that to be displayed. That way you can do the fade on this new node and all children will fade. If, later on, you have other things (such as a special HUD) parented to the camera nodepath, then that will not be faded by mistake.

Just an idea.

well I have a second camera that is elsewhere in the world that is displayed through a frame on render2d. If I hide render, will render2d hide as well?

Basically I want to hide everything except the frame on render2d and what is being displayed (which is parented to render) through the frame.

I thought I could just set the base.camNode alpha to 0 which would effectively kill the scene except for the frame, but I’m not sure if this would work.

render is the node you want to hide or make transparent, not the camera. Setting attributes on the camera node won’t have much effect, since the scene is not parented to the camera.

Also note that you might need to do render.setTransparency(1) to enable transparency, if you intend to use alpha to indicate transparency (I think the manual talks about the interplay between alpha and transparency).

And setting alpha to 0 on the whole scene will make it invisible, but it’s still being rendered–it would be better to hide it so that it won’t be rendered at all.

If you hide render, it does not affect render2d.

David