Camera¶
from acron.core import Camera
- class Camera¶
Bases:
Bases:
LensNodeA node that can be positioned around in the scene graph to represent a point of view for rendering a scene.
Inheritance diagram
digraph inheritance2c2438f5f5 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "AcronNode" [URL="acron.core.AcronNode.html#acron.core.AcronNode",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedWritableReferenceCount" -> "AcronNode" [arrowsize=0.75,style=""]; "Namable" -> "AcronNode" [arrowsize=0.75,style=""]; "Camera" [URL="acron.core.Camera.html#acron.core.Camera",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "LensNode" -> "Camera" [arrowsize=0.75,style=""]; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "LensNode" [URL="acron.core.LensNode.html#acron.core.LensNode",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "AcronNode" -> "LensNode" [arrowsize=0.75,style=""]; "Namable" [URL="acron.core.Namable.html#acron.core.Namable",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" -> "Namable" [arrowsize=0.75,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",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" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",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" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedWritable" [URL="acron.core.TypedWritable.html#acron.core.TypedWritable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedWritable" [arrowsize=0.75,style=""]; "TypedWritableReferenceCount" [URL="acron.core.TypedWritableReferenceCount.html#acron.core.TypedWritableReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedWritable" -> "TypedWritableReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedWritableReferenceCount" [arrowsize=0.75,style=""]; }- __init__()¶
- property active bool¶
- Getter
Returns the current setting of the active flag on the camera.
- Setter
Sets the active flag on the camera. When the camera is not active, nothing will be rendered.
- property aux_scene_data AuxSceneData¶
- Getter
Returns the
AuxSceneDataassociated with the indicatedNodePath, or NULL if nothing is associated.- Setter
Associates the indicated
AuxSceneDataobject with the givenNodePath, possibly replacing a previous data defined for the sameNodePath, if any.
- property camera_mask DrawMask¶
- Getter
Returns the set of bits that represent the subset of the scene graph the camera will render. See
set_camera_mask().- Setter
Changes the set of bits that represent the subset of the scene graph the camera will render.
During the cull traversal, a node is not visited if none of its draw mask bits intersect with the camera’s camera mask bits. These masks can be used to selectively hide and show different parts of the scene graph from different cameras that are otherwise viewing the same scene.
- cleanup_aux_scene_data()¶
Walks through the list of currently-assigned
AuxSceneDataobjects and releases any that are past their expiration times. Returns the number of elements released.
- clear_aux_scene_data()¶
Removes the
AuxSceneDataassociated with the indicatedNodePath. Returns true if it is removed successfully, false if it was already gone.
- clear_tag_state()¶
Removes the association established by a previous call to
set_tag_state().
- clear_tag_states()¶
Removes all associations established by previous calls to
set_tag_state().
- property cull_bounds BoundingVolume¶
- Getter
Returns the custom cull volume that was set by
set_cull_bounds(), if any, or NULL if no custom cull volume was set.- Setter
Specifies the bounding volume that should be used to perform culling from this camera. Normally, this is the bounding volume returned from the active lens’ make_bounds() call, but you may override this to specify a custom volume if you require. The specified bounding volume will be understood to be in the coordinate space of the
get_cull_center()node.
- property cull_center NodePath¶
- Getter
Returns the point from which the culling operations will be performed, if it was set by
set_cull_center(), or the emptyNodePathotherwise.- Setter
Specifies the point from which the culling operations are performed. Normally, this is the same as the camera, and that is the default if this is not specified; but it may sometimes be useful to perform the culling from some other viewpoint, particularly when you are debugging the culling itself.
- property display_regions Sequence[DisplayRegion]¶
Returns the nth display region associated with the camera.
- get_aux_scene_data()¶
Returns the
AuxSceneDataassociated with the indicatedNodePath, or NULL if nothing is associated.
- get_camera_mask()¶
Returns the set of bits that represent the subset of the scene graph the camera will render. See
set_camera_mask().
- static get_class_type()¶
- get_cull_bounds()¶
Returns the custom cull volume that was set by
set_cull_bounds(), if any, or NULL if no custom cull volume was set.
- get_cull_center()¶
Returns the point from which the culling operations will be performed, if it was set by
set_cull_center(), or the emptyNodePathotherwise.
- get_display_region()¶
Returns the nth display region associated with the camera.
- get_initial_state()¶
Returns the initial state as set by a previous call to
set_initial_state().
- get_lod_center()¶
Returns the point from which the LOD distances will be measured, if it was set by
set_lod_center(), or the emptyNodePathotherwise.
- get_lod_scale()¶
Returns the multiplier for LOD distances.
- get_num_display_regions()¶
Returns the number of display regions associated with the camera.
- get_scene()¶
Returns the scene that will be rendered by the camera. See
set_scene().
- get_tag_state()¶
Returns the state associated with the indicated tag state by a previous call to
set_tag_state(), or the empty state if nothing has been associated.
- get_tag_state_key()¶
Returns the tag key as set by a previous call to
set_tag_state_key().
- has_tag_state()¶
Returns true if
set_tag_state()has previously been called with the indicated tag state, false otherwise.
- property initial_state ConstPointerTo_RenderState¶
- Getter
Returns the initial state as set by a previous call to
set_initial_state().- Setter
Sets the initial state which is applied to all nodes in the scene, as if it were set at the top of the scene graph.
- is_active()¶
Returns the current setting of the active flag on the camera.
- list_aux_scene_data()¶
Outputs all of the
NodePathsandAuxSceneDatasin use.
- property lod_center NodePath¶
- Getter
Returns the point from which the LOD distances will be measured, if it was set by
set_lod_center(), or the emptyNodePathotherwise.- Setter
Specifies the point from which the LOD distances are measured. Normally, this is the same as the camera, and that is the default if this is not specified; but it may sometimes be useful to perform the distance test from some other viewpoint. This may be used, for instance, to reduce LOD popping when the camera rotates in a small circle about an avatar.
- property lod_scale float¶
- Getter
Returns the multiplier for LOD distances.
- Setter
Sets the multiplier for LOD distances. This value is multiplied with the LOD scale set on LodNodes.
- property scene NodePath¶
- Getter
Returns the scene that will be rendered by the camera. See
set_scene().- Setter
Sets the scene that will be rendered by the camera. This is normally the root node of a scene graph, typically a node called ‘render’, although it could represent the root of any subgraph.
Note that the use of this method is now deprecated. In the absence of an explicit scene set on the camera, the camera will render whatever scene it is parented into. This is the preferred way to specify the scene, since it is the more intuitive mechanism.
- set_active()¶
Sets the active flag on the camera. When the camera is not active, nothing will be rendered.
- set_aux_scene_data()¶
Associates the indicated
AuxSceneDataobject with the givenNodePath, possibly replacing a previous data defined for the sameNodePath, if any.
- set_camera_mask()¶
Changes the set of bits that represent the subset of the scene graph the camera will render.
During the cull traversal, a node is not visited if none of its draw mask bits intersect with the camera’s camera mask bits. These masks can be used to selectively hide and show different parts of the scene graph from different cameras that are otherwise viewing the same scene.
- set_cull_bounds()¶
Specifies the bounding volume that should be used to perform culling from this camera. Normally, this is the bounding volume returned from the active lens’ make_bounds() call, but you may override this to specify a custom volume if you require. The specified bounding volume will be understood to be in the coordinate space of the
get_cull_center()node.
- set_cull_center()¶
Specifies the point from which the culling operations are performed. Normally, this is the same as the camera, and that is the default if this is not specified; but it may sometimes be useful to perform the culling from some other viewpoint, particularly when you are debugging the culling itself.
- set_initial_state()¶
Sets the initial state which is applied to all nodes in the scene, as if it were set at the top of the scene graph.
- set_lod_center()¶
Specifies the point from which the LOD distances are measured. Normally, this is the same as the camera, and that is the default if this is not specified; but it may sometimes be useful to perform the distance test from some other viewpoint. This may be used, for instance, to reduce LOD popping when the camera rotates in a small circle about an avatar.
- set_lod_scale()¶
Sets the multiplier for LOD distances. This value is multiplied with the LOD scale set on LodNodes.
- set_scene()¶
Sets the scene that will be rendered by the camera. This is normally the root node of a scene graph, typically a node called ‘render’, although it could represent the root of any subgraph.
Note that the use of this method is now deprecated. In the absence of an explicit scene set on the camera, the camera will render whatever scene it is parented into. This is the preferred way to specify the scene, since it is the more intuitive mechanism.
- set_tag_state()¶
Associates a particular state transition with the indicated tag value. When a node is encountered during traversal with the tag key specified by
set_tag_state_key(), if the value of that tag matches tag_state, then the indicated state is applied to this node–but only when it is rendered by this camera.This can be used to apply special effects to nodes when they are rendered by certain cameras. It is particularly useful for multipass rendering, in which specialty cameras might be needed to render the scene with a particular set of effects.
- set_tag_state_key()¶
Sets the tag key which, when encountered as a tag on nodes in the scene graph, causes this Camera to apply an arbitrary state transition based on the value of the tag (as specified to
set_tag_state()).
- property tag_state_key string¶
- Getter
Returns the tag key as set by a previous call to
set_tag_state_key().- Setter
Sets the tag key which, when encountered as a tag on nodes in the scene graph, causes this Camera to apply an arbitrary state transition based on the value of the tag (as specified to
set_tag_state()).
- property tag_states ConstPointerTo_RenderState¶
- Getter
Returns the state associated with the indicated tag state by a previous call to
set_tag_state(), or the empty state if nothing has been associated.- Setter
Associates a particular state transition with the indicated tag value. When a node is encountered during traversal with the tag key specified by
set_tag_state_key(), if the value of that tag matches tag_state, then the indicated state is applied to this node–but only when it is rendered by this camera.This can be used to apply special effects to nodes when they are rendered by certain cameras. It is particularly useful for multipass rendering, in which specialty cameras might be needed to render the scene with a particular set of effects.