Skip to content
On this page

class Material

Material object that keeps material information used while rendering.

Properties

PropertyDescription
BlendModeMaterial blend mode specifies which type of blend function to use to blend materials. The blend mode function will be used while blending layers during material casting.
MaterialEvaluationShaderThe material evaluation shader.
MaterialGUIDThe unique id for this node.
MaterialTypeThe material type, used to specify which shader should be used to render the material.
NameThe name of the Material object. (Inherited from Object)
OpacityChannelThe name of the channel in the material to be used for Opacity or Transparency. This material property is primarily used in the scene exporters to correctly export opacity, and does *not* determine which channel to use for opacity when casting materials. The channel to be used for opacity during casting is controlled by a setting on the MaterialCaster objects.
OpacityCutoffThe cutoff value for opacity when using mask blend mode.
OpacityTypeThe opacity type determines how the opacity channel of this material is interpreted when casting. To make (0.0->1.0) map to (transparent-opaque), use 'Opacity'. To make (0.0->1.0) map to (opaque-transparent), use 'Transparency'
UseTangentSpaceNormalsThe UseTangentSpaceNormals flag. If set, the normal map has tangent space normals.

Methods

MethodDescription
AddMaterialChannelAdd a material channel.
AddObserverAdds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)
ChangeTexturePrefixPathChanges the prefix path (drive, directory) of all matching texture paths in the material, with the new one. This method is useful when external textures are placed in a specific folder, which needs to be moved.
ConvertHandednessConverts parameters such as UVTiling and UVOffset in shading networks.
GetClassGet the name of the Material class. (Inherited from Object)
GetMaterialChannelCountReturns the number of material channels in the material.
GetMaterialChannelFromIndexReturns the name of a channel from the index. Note that by adding/removing channels the indices are changed, and this method should only be used for enumeration.
GetMaterialChannelsGet all unique material channel names in the material.
GetMaterialChannelsWithTextureInputsGet all unique material channel names having texture inputs in the material.
GetShadingNetworkGet which shading network to use for the material channel.
HasMaterialChannelCheck if the channel exists within the material.
IsAReturns true if Material is a or is a descendant of the class named as the type parameter. (Inherited from Object)
IsIdenticalToReturns true if the material is setup identical to this material.
IsNullReturns true if the Material object is invalid. (Inherited from Object)
IsSameObjectAsReturns true if the Material object is valid. (Inherited from Object)
IsTransparentReturns true if the material *could* be transparent. In other words, returns true IF the BlendMode of the material is not set to opaque, AND there is a non-opaque shading network assigned to the opacity channel. This means materials set to BlendMode::Blend can still return false if they have an opacity channel set that is either empty, or constant and set to an opaque value. This can be used to split transparent and opaque materials before processing, or find materials marked as BlendMode::Blend that don't have to be.
LoadShadingNetworkFromXMLSave shading network to XML.
NonNullReturns true if the Material object is valid. (Inherited from Object)
PrintInfoPrints the content/info of the Material object to the log. (Inherited from Object)
RemoveMaterialChannelRemove a material channel.
RemoveObserverRemoves a previously added observer object. (Inherited from Object)
SaveShadingNetworkToXMLSave shading network to XML.
SetOpacityFromDiffuseAlphaMaps the alpha component of the diffuse channel to all the RGBA components in the opacity channel (by using a swizzle node).
SetShadingNetworkSet which shading network to use for the material channel.

Static methods

MethodDescription
IsClassAReturns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)
SafeCastSafeCast makes sure the input object is of a class that can be cast into spMaterial, and if this is the case, returns the object cast into spMaterial. (Inherited from Object)

Properties details

BlendMode

Material blend mode specifies which type of blend function to use to blend materials. The blend mode function will be used while blending layers during material casting.

MaterialEvaluationShader

The material evaluation shader.

MaterialGUID

The unique id for this node.

MaterialType

The material type, used to specify which shader should be used to render the material.

Name

The name of the Material object. (Inherited from Object)

OpacityChannel

The name of the channel in the material to be used for Opacity or Transparency. This material property is primarily used in the scene exporters to correctly export opacity, and does *not* determine which channel to use for opacity when casting materials. The channel to be used for opacity during casting is controlled by a setting on the MaterialCaster objects.

OpacityCutoff

The cutoff value for opacity when using mask blend mode.

OpacityType

The opacity type determines how the opacity channel of this material is interpreted when casting. To make (0.0->1.0) map to (transparent-opaque), use 'Opacity'. To make (0.0->1.0) map to (opaque-transparent), use 'Transparency'

UseTangentSpaceNormals

The UseTangentSpaceNormals flag. If set, the normal map has tangent space normals.

Methods details

AddMaterialChannel

Add a material channel.

AddObserver

Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)

ChangeTexturePrefixPath

Changes the prefix path (drive, directory) of all matching texture paths in the material, with the new one. This method is useful when external textures are placed in a specific folder, which needs to be moved.

ConvertHandedness

Converts parameters such as UVTiling and UVOffset in shading networks.

GetClass

Get the name of the Material class. (Inherited from Object)

GetMaterialChannelCount

Returns the number of material channels in the material.

GetMaterialChannelFromIndex

Returns the name of a channel from the index. Note that by adding/removing channels the indices are changed, and this method should only be used for enumeration.

GetMaterialChannels

Get all unique material channel names in the material.

GetMaterialChannelsWithTextureInputs

Get all unique material channel names having texture inputs in the material.

GetShadingNetwork

Get which shading network to use for the material channel.

HasMaterialChannel

Check if the channel exists within the material.

IsA

Returns true if Material is a or is a descendant of the class named as the type parameter. (Inherited from Object)

IsIdenticalTo

Returns true if the material is setup identical to this material.

IsNull

Returns true if the Material object is invalid. (Inherited from Object)

IsSameObjectAs

Returns true if the Material object is valid. (Inherited from Object)

IsTransparent

Returns true if the material *could* be transparent. In other words, returns true IF the BlendMode of the material is not set to opaque, AND there is a non-opaque shading network assigned to the opacity channel. This means materials set to BlendMode::Blend can still return false if they have an opacity channel set that is either empty, or constant and set to an opaque value. This can be used to split transparent and opaque materials before processing, or find materials marked as BlendMode::Blend that don't have to be.

LoadShadingNetworkFromXML

Save shading network to XML.

NonNull

Returns true if the Material object is valid. (Inherited from Object)

PrintInfo

Prints the content/info of the Material object to the log. (Inherited from Object)

RemoveMaterialChannel

Remove a material channel.

RemoveObserver

Removes a previously added observer object. (Inherited from Object)

SaveShadingNetworkToXML

Save shading network to XML.

SetOpacityFromDiffuseAlpha

Maps the alpha component of the diffuse channel to all the RGBA components in the opacity channel (by using a swizzle node).

SetShadingNetwork

Set which shading network to use for the material channel.

Static methods details

IsClassA

Returns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)

SafeCast

SafeCast makes sure the input object is of a class that can be cast into spMaterial, and if this is the case, returns the object cast into spMaterial. (Inherited from Object)