alias_api.AlEnvironment

class alias_api.AlEnvironment

Bases: AlObject

Base object for representing shader environment data

This class encapsulates the basic functionality for checking and setting the name of an environment. It also encapsulates accessing the textures that a particular environment refers to, and the animation on the environment. When the wire file is read, the environment contained therein are created as an AlEnvironment class object. This environment object is accessible through the AlUniverse class.

An environment 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 environment object references. next_texture() moves from a given referenced texture to the next texture in order, as related to the environment object. (See the similar methods for the AlTexture/AlShader classes.)

The animation on the environment can be accessed through the first_channel() and next_channel() methods. All the channels on the environment can be deleted by calling deleteAnimation().

The environment 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 environment parameters can be seen in the file AlAnim.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.

The user can neither create nor destroy an AlEnvironment class object at this time.

add_texture(self: alias_api.AlEnvironment, field_name: str, texture_type: str) tuple[int, alias_api.AlTexture]

Add a texture to the field of the AlEnvironment.

apply_iterator_to_textures(self: alias_api.AlEnvironment, iter: AlIterator, retcode: SupportsInt) int

Applies the given AlIterator to all textures of this environment. The second argument will be set to the return value of the last application of the iterator’s function.

copy_wrapper(self: alias_api.AlEnvironment) alias_api.AlObject

Return an exact duplicate of this AlEnvironment wrapper.

delete_object(self: alias_api.AlEnvironment) int

Delete the Alias shader object and return the status code of the delete operation.

fields(self: alias_api.AlEnvironment) list[alias_api.AlShadingFields]

Returns a list of ShadingFieldItems, each of which contains an ShadingFields value valid for this environment.

first_texture(self: alias_api.AlEnvironment) alias_api.AlTexture

Return the first texture.

mapped_fields(self: alias_api.AlEnvironment) list[str]

Return a list of all the mapped fields used by the environment.

property name

Get or set the AlEnvironment name.

next_texture(self: alias_api.AlEnvironment, cur_texture: alias_api.AlTexture) alias_api.AlTexture

Return the next texture. WARNING: this function may be broken and only returns the first texture.

parameter(self: alias_api.AlEnvironment, parameter_name: alias_api.AlShadingFields) tuple[int, float]

Finds the value of a given texture field.

remove_texture(self: alias_api.AlEnvironment, field_name: str) int

Remove the texture from the field of the AlEnvironment.

set_parameter(self: alias_api.AlEnvironment, parameter_name: alias_api.AlShadingFields, value: SupportsFloat) int

Changes the value of the texture field.

type(self: alias_api.AlEnvironment) alias_api.AlObjectType

Return the AlEnvironment type identifier.