alias_api.AlShader
- class alias_api.AlShader
Bases:
AlObjectBase object for representing shader data
This class encapsulates the basic functionality for checking and setting the name of a shader as well as accessing the textures that a particular shader refers to, and the animation on the shader. Shader objects are accessible through both the AlUniverse class and the objects that reference them (AlSurface and AlFace classes).
A shader object may reference textures. The first_texture() and next_texture() methods are used to access these textures.
first_texture() returns the first texture that the shader object references. next_texture() moves from a given referenced texture to the next texture in order, as related to the shader object. (See the similar methods for the AlTexture/AlEnvironment classes.)
The animation on a shader can be accessed through the first_channel() and next_channel() methods. All the channels on the shader can be deleted by calling deleteAnimation().
The shader parameters can be accessed through the parameter() and setParameter() methods. Each shader has a specific set of parameters that are valid for it that depend on its type. The full list of shader parameters can be seen in the file AlShadingFields.h. For example, all parameters specific to the Blinn shader have names of the form kFLD_SHADING_BLINN_*. Parameters common to all shaders have the form kFLD_SHADING_COMMON_*. All parameters are treated as doubles even though this may not necessarily be what they are. This is done to make the interface as simple and consistent as possible.
- add_texture(self: alias_api.AlShader, field_name: str, texture_name: str) tuple[int, alias_api.AlTexture]
Add a texture to the field of the AlShader.
- apply_iterator_to_textures(self: alias_api.AlShader, iter: AlIterator, retcode: SupportsInt) int
Applies the given AlIterator to all textures of this shader. The second argument will be set to the return value of the last application of the iterator’s function.
- copy_object(self: alias_api.AlShader) alias_api.AlShader
Copy this AlShader object and return the new object, or None if the copy operation failed.
- copy_wrapper(self: alias_api.AlShader) alias_api.AlObject
Return an exact duplicate of this AlShader wrapper.
- create(self: alias_api.AlShader) int
Initialize and allocate space for the AlShader and add it to the global list of shaders in the Alias Universe.
- delete_object(self: alias_api.AlShader, force: bool = False) int
Delete the AlObject from the Alias Universe and return the status of the performed operation.
- fields(self: alias_api.AlShader) list[alias_api.AlShadingFields]
return a list of all the fields used by the texture.
- first_texture(self: alias_api.AlShader) alias_api.AlTexture
Return the first texture under this shader.
- get_assigned_nodes(self: alias_api.AlShader) list[alias_api.AlDagNode]
Return the list of AlDagNodes that are assigned to this AlShader.
- Returns
The list of dag nodes
- Return type
list<AlDagNode>
- is_assigned(self: alias_api.AlShader, node: alias_api.AlDagNode) bool
Return True if the node is assigned to the shader, else False.
- is_used(self: alias_api.AlShader) int
Return True if the AlShader is being used by another object.
- mapped_fields(self: alias_api.AlShader) list[str]
return a list of all the mapped fields used by the shader.
- property name
Get or set the unique identifying name property.
- next_texture(self: alias_api.AlShader, cur_texture: alias_api.AlTexture) alias_api.AlTexture
Get the next texture under this shader.
- parameter(self: alias_api.AlShader, parameter_name: alias_api.AlShadingFields) tuple[int, float]
Finds the value of a given texture field.
- remove_texture(self: alias_api.AlShader, field_name: str) int
Remove the texture from the field of the AlShader.
- set_parameter(self: alias_api.AlShader, parameter_name: alias_api.AlShadingFields, value: SupportsFloat) int
Changes the value of the texture field.
- property shading_model
Get or set the shading model property.
- type(self: alias_api.AlShader) alias_api.AlObjectType
Return the shader type identifier.