class
Material
Material object that keeps material information used while rendering.
Properties
Property | Description |
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. |
MaterialGUID | The unique id for this node. |
MaterialType | The material type, used to specify which shader should be used to render the material. |
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
Static methods
Method | Description |
IsClassA | Returns true if the class is a or is a descendant of the class named as the type parameter. |
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. |
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.
Syntax
SetBlendMode parameters
Type | Name | Min | Max | Description |
EMaterialBlendMode | value | | | The blend mode function used while blending layers during material casting. |
GetBlendMode return value
Type: EMaterialBlendMode
Default: Standard
Key | Value | Comment |
Opaque | 0 | Treat the material as fully opaque. Any opacity channel will be ignored. |
Mask | 1 | Use the opacity channel as a mask. Opacity values equal or greater than the opacity cutoff will yield opaque pixels, and opactity values less than the opacity cutoff will yield fully transparent pixels. |
Blend | 2 | Opacity values will be used to perform an alpha blend, final_color = (source_color * alpha) + (destination_color * (1 - alpha)). |
Syntax
SetBlendMode parameters
Type | Name | Min | Max | Description |
EMaterialBlendMode | value | | | The blend mode function used while blending layers during material casting. |
GetBlendMode return value
Type: ``````
Default: Standard
Key | Value | Comment |
Opaque | 0 | Treat the material as fully opaque. Any opacity channel will be ignored. |
Mask | 1 | Use the opacity channel as a mask. Opacity values equal or greater than the opacity cutoff will yield opaque pixels, and opactity values less than the opacity cutoff will yield fully transparent pixels. |
Blend | 2 | Opacity values will be used to perform an alpha blend, final_color = (source_color * alpha) + (destination_color * (1 - alpha)). |
Syntax
SetBlendMode parameters
Name | Type | Min | Max | Description |
value | EMaterialBlendMode | | | The blend mode function used while blending layers during material casting. |
GetBlendMode return value
Type: EMaterialBlendMode
Default: Standard
Key | Value | Comment |
EMaterialBlendMode_Opaque | 0 | Treat the material as fully opaque. Any opacity channel will be ignored. |
EMaterialBlendMode_Mask | 1 | Use the opacity channel as a mask. Opacity values equal or greater than the opacity cutoff will yield opaque pixels, and opactity values less than the opacity cutoff will yield fully transparent pixels. |
EMaterialBlendMode_Blend | 2 | Opacity values will be used to perform an alpha blend, final_color = (source_color * alpha) + (destination_color * (1 - alpha)). |
MaterialGUID
The unique id for this node.
Syntax
SetMaterialGUID parameters
Type | Name | Min | Max | Description |
const char * | value | | | The node id of type string. |
GetMaterialGUID return value
Type: spString
Syntax
SetMaterialGUID parameters
Type | Name | Min | Max | Description |
string | value | | | The node id of type string. |
GetMaterialGUID return value
Type: string
Syntax
SetMaterialGUID parameters
Name | Type | Min | Max | Description |
value | str | | | The node id of type string. |
GetMaterialGUID return value
Type: str
MaterialType
The material type, used to specify which shader should be used to render the material.
Syntax
SetMaterialType parameters
Type | Name | Min | Max | Description |
EMaterialType | value | | | The material type. One of the following: Standard -> Use the standard shader. Flipbook -> Use the flipbook shader. BillboardCloud -> Use the billboard cloud shader. |
GetMaterialType return value
Type: EMaterialType
Default: Standard
Key | Value | Comment |
Standard | 0 | Use the standard shader. |
Flipbook | 1 | Use the flipbook shader. |
BillboardCloud | 2 | Use the billboard cloud shader. |
Syntax
SetMaterialType parameters
Type | Name | Min | Max | Description |
EMaterialType | value | | | The material type. One of the following: Standard -> Use the standard shader. Flipbook -> Use the flipbook shader. BillboardCloud -> Use the billboard cloud shader. |
GetMaterialType return value
Type: ``````
Default: Standard
Key | Value | Comment |
Standard | 0 | Use the standard shader. |
Flipbook | 1 | Use the flipbook shader. |
BillboardCloud | 2 | Use the billboard cloud shader. |
Syntax
SetMaterialType parameters
Name | Type | Min | Max | Description |
value | EMaterialType | | | The material type. One of the following: Standard -> Use the standard shader. Flipbook -> Use the flipbook shader. BillboardCloud -> Use the billboard cloud shader. |
GetMaterialType return value
Type: EMaterialType
Default: Standard
Key | Value | Comment |
EMaterialType_Standard | 0 | Use the standard shader. |
EMaterialType_Flipbook | 1 | Use the flipbook shader. |
EMaterialType_BillboardCloud | 2 | Use the billboard cloud shader. |
OpacityCutoff
The cutoff value for opacity when using mask blend mode.
Syntax
SetOpacityCutoff parameters
Type | Name | Min | Max | Description |
real | value | | | The opacity cutoff value. |
GetOpacityCutoff return value
Type: real
Syntax
SetOpacityCutoff parameters
Type | Name | Min | Max | Description |
float | value | | | The opacity cutoff value. |
GetOpacityCutoff return value
Type: float
Syntax
SetOpacityCutoff parameters
Name | Type | Min | Max | Description |
value | float | | | The opacity cutoff value. |
GetOpacityCutoff return value
Type: float
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'
Syntax
SetOpacityType parameters
Type | Name | Min | Max | Description |
EOpacityType | value | | | The new opacity type. |
GetOpacityType return value
Type: EOpacityType
Default: Opacity
Key | Value | Comment |
Opacity | 0 | The level of transparency is defined from 0.0->1.0, where 0.0 is fully transparent and 1.0 is fully opaque. |
Transparency | 1 | The level of transparency is defined from 1.0->0.0, where 1.0 is fully transparent and 0.0 is fully opaque. |
Syntax
SetOpacityType parameters
Type | Name | Min | Max | Description |
EOpacityType | value | | | The new opacity type. |
GetOpacityType return value
Type: ``````
Default: Opacity
Key | Value | Comment |
Opacity | 0 | The level of transparency is defined from 0.0->1.0, where 0.0 is fully transparent and 1.0 is fully opaque. |
Transparency | 1 | The level of transparency is defined from 1.0->0.0, where 1.0 is fully transparent and 0.0 is fully opaque. |
Syntax
SetOpacityType parameters
Name | Type | Min | Max | Description |
value | EOpacityType | | | The new opacity type. |
GetOpacityType return value
Type: EOpacityType
Default: Opacity
Key | Value | Comment |
EOpacityType_Opacity | 0 | The level of transparency is defined from 0.0->1.0, where 0.0 is fully transparent and 1.0 is fully opaque. |
EOpacityType_Transparency | 1 | The level of transparency is defined from 1.0->0.0, where 1.0 is fully transparent and 0.0 is fully opaque. |
UseTangentSpaceNormals
The UseTangentSpaceNormals flag. If set, the normal map has tangent space normals.
Syntax
SetUseTangentSpaceNormals parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired flag value. |
GetUseTangentSpaceNormals return value
Type: bool
Syntax
SetUseTangentSpaceNormals parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired flag value. |
GetUseTangentSpaceNormals return value
Type: bool
Syntax
SetUseTangentSpaceNormals parameters
Name | Type | Min | Max | Description |
value | bool | | | The desired flag value. |
GetUseTangentSpaceNormals return value
Type: bool
Methods details
AddMaterialChannel
Add a material channel.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | channel_name | | | The name of the material channel. |
Syntax
Parameters
Type | Name | Min | Max | Description |
string | channel_name | | | The name of the material channel. |
Syntax
Parameters
Name | Type | Min | Max | Description |
channel_name | str | | | The name of the material channel. |
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.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | current_path_prefix | | | The current prefix path, either relative or absolute. |
const char * | new_path_prefix | | | The new prefix path. |
Syntax
Parameters
Type | Name | Min | Max | Description |
string | current_path_prefix | | | The current prefix path, either relative or absolute. |
string | new_path_prefix | | | The new prefix path. |
Syntax
Parameters
Name | Type | Min | Max | Description |
current_path_prefix | str | | | The current prefix path, either relative or absolute. |
new_path_prefix | str | | | The new prefix path. |
ConvertHandedness
Converts parameters such as UVTiling and UVOffset in shading networks.
Syntax
Parameters
ConvertHandedness takes no parameters.
Syntax
Parameters
ConvertHandedness takes no parameters.
Syntax
Parameters
ConvertHandedness takes no parameters.
GetClass
Get the name of the Material class.
Syntax
Parameters
GetClass takes no parameters.
Return value
Type: spString
Syntax
Parameters
GetClass takes no parameters.
Return value
Type: string
Syntax
Parameters
GetClass takes no parameters.
Return value
Type: str
GetMaterialChannelCount
Returns the number of material channels in the material.
Syntax
Parameters
GetMaterialChannelCount takes no parameters.
Return value
Type: unsigned int
Syntax
Parameters
GetMaterialChannelCount takes no parameters.
Return value
Type: uint
Syntax
Parameters
GetMaterialChannelCount takes no parameters.
Return value
Type: int
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.
Syntax
Parameters
Type | Name | Min | Max | Description |
rid | index | | | The index to the channel to be fetched. |
Return value
Type: spString
Syntax
Parameters
Type | Name | Min | Max | Description |
rid | index | | | The index to the channel to be fetched. |
Return value
Type: string
Syntax
Parameters
Name | Type | Min | Max | Description |
index | int | | | The index to the channel to be fetched. |
Return value
Type: str
GetMaterialChannels
Get all unique material channel names in the material.
Syntax
Parameters
Type | Name | Min | Max | Description |
StringArray | channels | | | The array receiving unique channel names. |
Syntax
Parameters
Type | Name | Min | Max | Description |
StringArray | channels | | | The array receiving unique channel names. |
Syntax
Parameters
Name | Type | Min | Max | Description |
channels | StringArray | | | The array receiving unique channel names. |
GetMaterialChannelsWithTextureInputs
Get all unique material channel names having texture inputs in the material.
Syntax
Parameters
Type | Name | Min | Max | Description |
StringArray | channels | | | The array receiving unique channel names. |
Syntax
Parameters
Type | Name | Min | Max | Description |
StringArray | channels | | | The array receiving unique channel names. |
Syntax
Parameters
Name | Type | Min | Max | Description |
channels | StringArray | | | The array receiving unique channel names. |
GetShadingNetwork
Get which shading network to use for the material channel.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | channel_name | | | The name of the channel. |
Return value
Type: ShadingNode
Syntax
Parameters
Type | Name | Min | Max | Description |
string | channel_name | | | The name of the channel. |
Return value
Type: ShadingNode
Syntax
Parameters
Name | Type | Min | Max | Description |
channel_name | str | | | The name of the channel. |
Return value
Type: ShadingNode
HasMaterialChannel
Check if the channel exists within the material.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | channel_name | | | The name of the material channel. |
Return value
Type: bool
Syntax
Parameters
Type | Name | Min | Max | Description |
string | channel_name | | | The name of the material channel. |
Return value
Type: bool
Syntax
Parameters
Name | Type | Min | Max | Description |
channel_name | str | | | The name of the material channel. |
Return value
Type: bool
IsA
Returns true if Material is a or is a descendant of the class named as the type parameter.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | type | | | Name of the class to check if Material is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Type | Name | Min | Max | Description |
string | type | | | Name of the class to check if Material is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Name | Type | Min | Max | Description |
type | str | | | Name of the class to check if Material is, or is a descendant of. |
Return value
Type: bool
IsIdenticalTo
Returns true if the material is setup identical to this material.
Syntax
Parameters
Type | Name | Min | Max | Description |
Material | mat | | | The material to compare to. |
Return value
Type: bool
Syntax
Parameters
Type | Name | Min | Max | Description |
Material | mat | | | The material to compare to. |
Return value
Type: bool
Syntax
Parameters
Name | Type | Min | Max | Description |
mat | Material | | | The material to compare to. |
Return value
Type: bool
IsNull
Returns true if the Material object is invalid.
Syntax
Parameters
IsNull takes no parameters.
Return value
Type: bool
Syntax
Parameters
IsNull takes no parameters.
Return value
Type: bool
Syntax
Parameters
IsNull takes no parameters.
Return value
Type: bool
IsTransparent
Returns true if the material could be transparent.
Syntax
Parameters
IsTransparent takes no parameters.
Return value
Type: bool
Syntax
Parameters
IsTransparent takes no parameters.
Return value
Type: bool
Syntax
Parameters
IsTransparent takes no parameters.
Return value
Type: bool
LoadShadingNetworkFromXML
Save shading network to XML.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | channel_name | | | The name of the channel. |
const char * | in_xml | | | The xml descriping the shading node graph. |
Syntax
Parameters
Type | Name | Min | Max | Description |
string | channel_name | | | The name of the channel. |
string | in_xml | | | The xml descriping the shading node graph. |
Syntax
Parameters
Name | Type | Min | Max | Description |
channel_name | str | | | The name of the channel. |
in_xml | str | | | The xml descriping the shading node graph. |
RemoveMaterialChannel
Remove a material channel.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | channel_name | | | The name of the material channel. |
Syntax
Parameters
Type | Name | Min | Max | Description |
string | channel_name | | | The name of the material channel. |
Syntax
Parameters
Name | Type | Min | Max | Description |
channel_name | str | | | The name of the material channel. |
SaveShadingNetworkToXML
Save shading network to XML.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | channel_name | | | The name of the channel. |
Return value
Type: spString
Syntax
Parameters
Type | Name | Min | Max | Description |
string | channel_name | | | The name of the channel. |
Return value
Type: string
Syntax
Parameters
Name | Type | Min | Max | Description |
channel_name | str | | | The name of the channel. |
Return value
Type: str
SetOpacityFromDiffuseAlpha
Maps the alpha component of the diffuse channel to all the RGBA components in the opacity channel (by using a swizzle node).
Syntax
Parameters
SetOpacityFromDiffuseAlpha takes no parameters.
Syntax
Parameters
SetOpacityFromDiffuseAlpha takes no parameters.
Syntax
Parameters
SetOpacityFromDiffuseAlpha takes no parameters.
SetShadingNetwork
Set which shading network to use for the material channel.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | channel_name | | | The name of the new channel. |
ShadingNode | node | | | The shading network exit node. |
Syntax
Parameters
Type | Name | Min | Max | Description |
string | channel_name | | | The name of the new channel. |
ShadingNode | node | | | The shading network exit node. |
Syntax
Parameters
Name | Type | Min | Max | Description |
channel_name | str | | | The name of the new channel. |
node | ShadingNode | | | The shading network exit node. |
Static methods details
IsClassA
Returns true if the class is a or is a descendant of the class named as the type parameter.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | type | | | Name of the class to check if the class is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Type | Name | Min | Max | Description |
string | type | | | Name of the class to check if the class is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Name | Type | Min | Max | Description |
type | str | | | Name of the class to check if the class is, or is a descendant of. |
Return value
Type: bool
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.
Syntax
Parameters
Type | Name | Min | Max | Description |
Object | object | | | Object to cast. |
Return value
Type: Material
Syntax
Parameters
Type | Name | Min | Max | Description |
Object | object | | | Object to cast. |
Return value
Type: Material
Syntax
Parameters
Name | Type | Min | Max | Description |
object | Object | | | Object to cast. |
Return value
Type: Material