TagStateManager

from panda3d._rplight import TagStateManager
class TagStateManager

Bases:

The TagStateManager stores a list of RenderStates assigned to different steps in the pipeline. For example, there are a list of shadow states, which are applied whenever objects are rendered from a shadow camera.

The Manager also stores a list of all cameras used in the different stages, to keep track of the states used and to be able to attach new states.

Inheritance diagram

Inheritance diagram of TagStateManager

__init__(main_cam_node: panda3d.core.NodePath)

This constructs a new TagStateManager. The #main_cam_node should refer to the main scene camera, and will most likely be base.cam. It is necessary to pass the camera because the C++ code does not have access to the showbase.

__init__(param0: TagStateManager)
applyState(state: str, np: panda3d.core.NodePath, shader: panda3d.core.Shader, name: str, sort: int)

This applies a shader to the given NodePath which is used when the NodePath is rendered by any registered camera for that pass. It also disables color write depending on the pass.

cleanupStates()

This cleans up all states which were registered to the TagStateManager. It also calls Camera.clearTagStates() on the main_cam_node and all attached cameras.

getMask(container_name: str) panda3d.core.BitMask32

This returns the mask of a given render pass, which can be used to either show or hide objects from this pass.

registerCamera(state: str, source: panda3d.core.Camera)

This registers a new camera which will be used to render the given pass. The TagStateManager will keep track of the camera and applies all registered states onto the camera with Camera.setTagState. It also applies the appropriate camera mask to the camera, and sets an initial state to disable color write depending on the pass.

unregisterCamera(state: str, source: panda3d.core.Camera)

This unregisters a camera from the list of shadows cameras. It also resets all tag states of the camera, and also its initial state.