LightAttrib¶
from acron.core import LightAttrib
- class LightAttrib¶
Bases:
Bases:
RenderAttribIndicates which set of lights should be considered “on” to illuminate geometry at this level and below. A LightAttrib can either add lights or remove lights from the total set of “on” lights.
Inheritance diagram
digraph inheritance5e16084727 { 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=""]; "LightAttrib" [URL="acron.core.LightAttrib.html#acron.core.LightAttrib",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "RenderAttrib" -> "LightAttrib" [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=""]; "RenderAttrib" [URL="acron.core.RenderAttrib.html#acron.core.RenderAttrib",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedWritableReferenceCount" -> "RenderAttrib" [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=""]; }-
enum Operation
This is the old, deprecated interface to
LightAttrib. Do not use any of these methods for new code; these methods will be removed soon.-
enumerator O_set = 0
-
enumerator O_add = 1
-
enumerator O_remove = 2
-
enumerator O_set = 0
- add_light()¶
Returns a new
LightAttrib, just like this one, but with the indicated light added to the list of lights.Deprecated: Use
add_on_light()oradd_off_light()instead.
- add_off_light()¶
Returns a new
LightAttrib, just like this one, but with the indicated light added to the list of lights turned off by this attrib.
- add_on_light()¶
Returns a new
LightAttrib, just like this one, but with the indicated light added to the list of lights turned on by this attrib.
- get_ambient_contribution()¶
Returns the total contribution of all the ambient lights.
- static get_class_slot()¶
- static get_class_type()¶
- get_light()¶
Returns the nth light listed in the attribute.
Deprecated:
LightAttribsnowadays have a separate list of on_lights andoff_lights, so this method no longer makes sense. Query the lists independently.
- get_most_important_light()¶
Returns the most important light (that is, the light with the highest priority) in the
LightAttrib, excluding any ambient lights. Returns an emptyNodePathif no non-ambient lights are found.
- get_num_lights()¶
Returns the number of lights listed in the attribute.
Deprecated:
LightAttribsnowadays have a separate list of on_lights andoff_lights, so this method no longer makes sense. Query the lists independently.
- get_num_non_ambient_lights()¶
Returns the number of non-ambient lights that are turned on by this attribute.
- get_num_off_lights()¶
Returns the number of lights that are turned off by the attribute.
- get_num_on_lights()¶
Returns the number of lights that are turned on by the attribute.
- get_off_light()¶
Returns the nth light turned off by the attribute, sorted in arbitrary (pointer) order.
- get_on_light()¶
Returns the nth light turned on by the attribute, sorted in render order.
- get_operation()¶
Returns the basic operation type of the
LightAttrib. If this is O_set, the lights listed here completely replace any lights that were already on. If this is O_add, the lights here are added to the set of lights that were already on, and if O_remove, the lights here are removed from the set of lights that were on.Deprecated:
LightAttribsnowadays have a separate list of on_lights andoff_lights, so this method no longer makes sense. Query the lists independently.
- has_all_off()¶
Returns true if this attrib turns off all lights (although it may also turn some on).
- has_any_on_light()¶
Returns true if any light is turned on by the attrib, false otherwise.
- has_light()¶
Returns true if the indicated light is listed in the attrib, false otherwise.
Deprecated:
LightAttribsnowadays have a separate list of on_lights andoff_lights, so this method no longer makes sense. Query the lists independently.
- has_off_light()¶
Returns true if the indicated light is turned off by the attrib, false otherwise.
- has_on_light()¶
Returns true if the indicated light is turned on by the attrib, false otherwise.
- is_identity()¶
Returns true if this is an identity attrib: it does not change the set of lights in use.
- static make()¶
The following is the new, more general interface to the
LightAttrib.Constructs a new
LightAttribobject that turns on (or off, according to op) the indicated light(s).Deprecated: Use
add_on_light()oradd_off_light()instead.Constructs a new
LightAttribobject that turns on (or off, according to op) the indicate light(s).Deprecated: Use
add_on_light()oradd_off_light()instead.Constructs a new
LightAttribobject that turns on (or off, according to op) the indicate light(s).Deprecated: Use
add_on_light()oradd_off_light()instead.Constructs a new
LightAttribobject that turns on (or off, according to op) the indicate light(s).Deprecated: Use
add_on_light()oradd_off_light()instead.Constructs a new
LightAttribobject that does nothing.
- static make_all_off()¶
Constructs a new
LightAttribobject that turns off all lights (and hence disables lighting).
- static make_default()¶
Returns a
RenderAttribthat corresponds to whatever the standard default properties for render attributes of this type ought to be.
- property off_lights Sequence[NodePath]¶
Returns the nth light turned off by the attribute, sorted in arbitrary (pointer) order.
- property on_lights Sequence[NodePath]¶
Returns the nth light turned on by the attribute, sorted in render order.
- remove_light()¶
Returns a new
LightAttrib, just like this one, but with the indicated light removed from the list of lights.Deprecated: Use
remove_on_light()orremove_off_light()instead.
- remove_off_light()¶
Returns a new
LightAttrib, just like this one, but with the indicated light removed from the list of lights turned off by this attrib.
- remove_on_light()¶
Returns a new
LightAttrib, just like this one, but with the indicated light removed from the list of lights turned on by this attrib.
- replace_off_light()¶
Returns a new
LightAttrib, just like this one, but with the indicated light replaced with the given other light.
- replace_on_light()¶
Returns a new
LightAttrib, just like this one, but with the indicated light replaced with the given other light.
-
enum Operation