# class Texture

Texture describes a texture object, containing either image data or a path that is referenced by texture nodes in materials.

# Properties

Property Description
FilePath The file path of the texture. This path has two meanings: It can point to an existing file to use as image data for the texture if the image data object is not set. If the image data object is set on the texture, it is the path to where the image should be saved if the owning scene is exported. If you run a pipeline through the batch tool and Simplygon Grid, the returned texture object will have the image data embedded in the texture objects and this path indicates where it should be saved if the texture are to be stored separately. Use ExportImageData() to write out embedded data to the file path, then use GetFilePath() to get the final path for the texture image file.
ImageData Set/Get a named texture image data. If this is defined, it will be used instead of the texture file defined in GetFilePath/SetFilePath(). See the help for GetFilePath() for additional information regarding the file path meaning in conjunction with embedded image data objects.

# Methods

Method Description
ChangeTexturePrefixPath Changes the prefix path (drive, directory) in the texture, with the new one, if the current path matches the current_path_prefix. This method is useful when external textures are placed in a specific folder, which needs to be moved.
ExportImageData Write out the embedded image data to the file indicated by the set file path. Once this method returns, use GetFilePath() to get the potentially updated final file path used to write the image data file.
GetClass Get the name of the Texture class.
IsA Returns true if Texture is a or is a descendant of the class named as the type parameter.
IsNull Returns true if the Texture object is invalid.

# 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 spTexture, and if this is the case, returns the object cast into spTexture.

# Properties details

# FilePath

The file path of the texture. This path has two meanings: It can point to an existing file to use as image data for the texture if the image data object is not set. If the image data object is set on the texture, it is the path to where the image should be saved if the owning scene is exported. If you run a pipeline through the batch tool and Simplygon Grid, the returned texture object will have the image data embedded in the texture objects and this path indicates where it should be saved if the texture are to be stored separately. Use ExportImageData() to write out embedded data to the file path, then use GetFilePath() to get the final path for the texture image file.

    # ImageData

    Set/Get a named texture image data. If this is defined, it will be used instead of the texture file defined in GetFilePath/SetFilePath(). See the help for GetFilePath() for additional information regarding the file path meaning in conjunction with embedded image data objects.

      # Methods details

      # ChangeTexturePrefixPath

      Changes the prefix path (drive, directory) in the texture, with the new one, if the current path matches the current_path_prefix. This method is useful when external textures are placed in a specific folder, which needs to be moved.

        # ExportImageData

        Write out the embedded image data to the file indicated by the set file path. Once this method returns, use GetFilePath() to get the potentially updated final file path used to write the image data file.

          # GetClass

          Get the name of the Texture class.

            # IsA

            Returns true if Texture is a or is a descendant of the class named as the type parameter.

              # IsNull

              Returns true if the Texture object is invalid.

                # 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 spTexture, and if this is the case, returns the object cast into spTexture.