Skip to content

Actors - Materials Module

anvil.api.actors.materials

Material

A class representing a material with customizable states and definitions.

Attributes:

Name Type Description
Material_name str

The name of the material.

Material dict

The attributes and states of the material.

__init__(material_name, baseMaterial)

Initializes a Material instance.

Parameters:

Name Type Description Default
material_name str

The name of the material.

required
baseMaterial str

The base material's name, if any.

required

add_defines(*defines)

Adds defines to the material.

Parameters:

Name Type Description Default
defines MaterialDefinitions

The defines to be added.

()

Returns:

Name Type Description
Material

The instance of the class to enable method chaining.

add_states(*states)

Adds states to the material.

Parameters:

Name Type Description Default
states MaterialStates

The material states to be added.

()

Returns:

Name Type Description
Material

The instance of the class to enable method chaining.

backFace(stencilFunc=None, stencilFailOp=None, stencilDepthFailOp=None, stencilPassOp=None, stencilPass=None)

Sets the back face stencil properties of the material.

Parameters:

Name Type Description Default
stencilFunc MaterialFunc

The function for the stencil.

None
stencilFailOp MaterialOperation

The operation on fail for the stencil.

None
stencilDepthFailOp MaterialOperation

The operation on depth fail for the stencil.

None
stencilPassOp MaterialOperation

The operation on pass for the stencil.

None
stencilPass MaterialOperation

The pass for the stencil.

None

Returns:

Name Type Description
Material

The instance of the class to enable method chaining.

defines(*defines)

Sets the defines for the material.

Parameters:

Name Type Description Default
defines MaterialDefinitions

The defines for the material.

()

Returns:

Name Type Description
Material

The instance of the class to enable method chaining.

depthFunc(depthFunc)

Sets the depth function of the material.

Parameters:

Name Type Description Default
depthFunc MaterialFunc

The function for the depth.

required

Returns:

Name Type Description
Material

The instance of the class to enable method chaining.

frontFace(stencilFunc=None, stencilFailOp=None, stencilDepthFailOp=None, stencilPassOp=None, stencilPass=None)

Sets the front face stencil properties of the material.

Parameters:

Name Type Description Default
stencilFunc MaterialFunc

The function for the stencil.

None
stencilFailOp MaterialOperation

The operation on fail for the stencil.

None
stencilDepthFailOp MaterialOperation

The operation on depth fail for the stencil.

None
stencilPassOp MaterialOperation

The operation on pass for the stencil.

None
stencilPass MaterialOperation

The pass for the stencil.

None

Returns:

Name Type Description
Material

The instance of the class to enable method chaining.

remove_defines(*defines)

Removes the defines for the material.

Parameters:

Name Type Description Default
defines MaterialDefinitions

The defines to be removed.

()

Returns:

Name Type Description
Material

The instance of the class to enable method chaining.

remove_states(*states)

Removes the states for the material.

Parameters:

Name Type Description Default
states MaterialStates

The material states to be removed.

()

Returns:

Name Type Description
Material

The instance of the class to enable method chaining.

states(*states)

Sets the states for the material.

Parameters:

Name Type Description Default
states MaterialStates

The material states to be set.

()

Returns:

Name Type Description
Material

The instance of the class to enable method chaining.

stencilRef(stencilRef)

Sets the stencil reference value of the material.

Parameters:

Name Type Description Default
stencilRef int

The reference value for the stencil.

required

Returns:

Name Type Description
Material

The instance of the class to enable method chaining.