TagStateManager¶
from acron._rplight import TagStateManager
- class TagStateManager¶
Bases:
The TagStateManager stores a list of
RenderStatesassigned 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
digraph inheritance478b408d26 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "TagStateManager" [URL="acron._rplight.TagStateManager.html#acron._rplight.TagStateManager",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TagStateManager" [arrowsize=0.75,style=""]; }- __init__()¶
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.
- apply_state()¶
This applies a shader to the given
NodePathwhich is used when theNodePathis rendered by any registered camera for that pass. It also disables color write depending on the pass.This applies a shader to the given
NodePathwhich is used when theNodePathis rendered by any registered camera of the container.
- cleanup_states()¶
This cleans up all states which were registered to the
TagStateManager. It also callsCamera.clear_tag_states()on the main_cam_node and all attached cameras.
- get_mask()¶
This returns the mask of a given render pass, which can be used to either show or hide objects from this pass.
- register_camera()¶
This registers a new camera which will be used to render the given pass. The
TagStateManagerwill keep track of the camera and applies all registered states onto the camera withCamera.set_tag_state. It also applies the appropriate camera mask to the camera, and sets an initial state to disable color write depending on the pass.This registers a new camera to a container, and sets its initial state as well as the camera mask.
- unregister_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.
This unregisters a camera from the list of cameras of a given container. It also resets all tag states of the camera, and also its initial state.