alias_api.AlLight
- class alias_api.AlLight
Bases:
AlObjectEncapsulates methods common to all lights.
This virtual class contains methods which are common to all types of lights. This includes color, linkage to objects and exclusivity.
To create a light, the user must instantiate and call the create method of a specific type of light (eg. a point light or a spot light). When a light is created, three light nodes are created, grouped under a group node, which is inserted into the universe’s dag. These light nodes represent the position, “look at” and “up” points of the light.
Even though three light nodes are created for all lights, only the spot light class uses the information in the “look at” and “up” nodes. All other classes either don’t have a direction or store direction in a different manner. The direction vector of a spot light is the vector between its position point and its “look at” point. The “up” direction vector of a spot light is the vector between its position point and its “up” point.
There are two ways to delete a light object. When an AlLight object is deleted, its three light nodes are deleted. Alternatively, when a light node is deleted, its associated light (and other light nodes) are deleted. The group node that originally grouped the position, “look at” and “up” nodes is not deleted.
The light classes are derived as follows, where a class inherits the functionality defined in the class above it. The user can only instantiate ambient, point, direction, spot, linear and area lights.
For directional lights, the light positions are (in Z-up coordinate system) position at (0,0,0), view at (0,0,-1), and up at (0,1,-1). For linear lights, the axis by default starts at the position point and extends (2,0,0). For area lights, the short axis starts at the position point and extends (0,1,0); the long axis starts at the position point and extends (2,0,0).
All lights have an “exclusive” flag. If this flag is TRUE, then the light will only illuminate objects to which it is linked. If the flag is False, the light will illuminate objects that have no light links. The default for new lights is False.
- delete_object(self: alias_api.AlLight) int
Delete the AlLight from the Alias Universe and return the status of the performed operation.
- first_linked_object(self: alias_api.AlLight) alias_api.AlObject
Return the first object that is linked to this light.
If there are no objects linked to this light, then Non is returned. Only objects with 3D geometry can be linked to a light. Cameras, lights, curves and CVs cannot be linked to a light. Surfaces and faces can be linked to a light.
- Returns
The first linked object.
- Return type
- has_linked_objects(self: alias_api.AlLight) int
Return True if this light has any objects linked to it, else False.
- light_node(self: alias_api.AlLight) AlLightNode
Return the dag node that represents the light’s position.
- look_at_node(self: alias_api.AlLight) AlLightNode
Return the ‘look at’ node attached to this light.
- property name
Get or set the AlLight name.
- next_linked_object(self: alias_api.AlLight, obj: alias_api.AlObject) alias_api.AlObject
Return the object following the given object that is linked to this linked.
None is returned if there is no following object or if the given object was not found in the light list. Only objects with 3D geometry can be linked to a light. Cameras, lights, curves and CVs cannot be linked to a light. Surfaces and faces can be linked to a light.
- Parameters
obj – the object whose following linked object is returned.
- Returns
The next linked object t othe given object.
- Return type
- type(self: alias_api.AlLight) alias_api.AlObjectType
Return the AlLight type identifier.
- up_node(self: alias_api.AlLight) AlLightNode
Return the ‘up’ node attached to this light.