# 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

Method Description
AddMaterialChannel Add a 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.
ConvertHandedness Converts parameters such as UVTiling and UVOffset in shading networks.
GetClass Get the name of the Material class.
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.
IsIdenticalTo Returns true if the material is setup identical to this material.
IsNull Returns true if the Material object is invalid.
IsTransparent Returns true if the material could be transparent.
LoadShadingNetworkFromXML Save shading network to XML.
RemoveMaterialChannel Remove a material channel.
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

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.

    # 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 details

              # AddMaterialChannel

              Add a 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.

                  # ConvertHandedness

                  Converts parameters such as UVTiling and UVOffset in shading networks.

                    # GetClass

                    Get the name of the Material class.

                      # 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.

                                    # IsIdenticalTo

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

                                      # IsNull

                                      Returns true if the Material object is invalid.

                                        # IsTransparent

                                        Returns true if the material could be transparent.

                                          # LoadShadingNetworkFromXML

                                          Save shading network to XML.

                                            # RemoveMaterialChannel

                                            Remove a material channel.

                                              # 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.

                                                      # 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.