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 |
ColorSpace | Used to override how Simplygon interprets the color space of the texture. Set to Undefined to not override, and let the color space be defined by the underlying image data object. |
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. |
Name | The name of the Texture object. (Inherited from Object) |
Methods
Method | Description |
AddObserver | Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object) |
Equals | Check for equality against other texture. If the texture is external, this method checks whether the path to the data is equal, otherwise it will compare the embedded image data of this texture. |
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. (Inherited from Object) |
IsA | Returns true if Texture is a or is a descendant of the class named as the type parameter. (Inherited from Object) |
IsNull | Returns true if the Texture object is invalid. (Inherited from Object) |
IsSameObjectAs | Returns true if the Texture object is valid. (Inherited from Object) |
NonNull | Returns true if the Texture object is valid. (Inherited from Object) |
PrintInfo | Prints the content/info of the Texture object to the log. (Inherited from Object) |
RemoveObserver | Removes a previously added observer object. (Inherited from Object) |
Static methods
Method | Description |
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 spTexture, and if this is the case, returns the object cast into spTexture. (Inherited from Object) |
Properties details
ColorSpace
Used to override how Simplygon interprets the color space of the texture. Set to Undefined to not override, and let the color space be defined by the underlying image data object.
Syntax
SetColorSpace parameters
Type | Name | Min | Max | Description |
EImageColorSpace | value | | | The value to set ColorSpace to. |
GetColorSpace return value
Type: EImageColorSpace
Default: EImageColorSpace::Undefined
Key | Value | Comment |
Undefined | 0 | The color space is undefined, or using the color space of an input image data. |
Linear | 1 | The color space is linear (linear gamma). |
sRGB | 2 | The color space is sRGB (nominal gamma of 2.2). |
Syntax
SetColorSpace parameters
Type | Name | Min | Max | Description |
EImageColorSpace | value | | | The value to set ColorSpace to. |
GetColorSpace return value
Type: EImageColorSpace
Default: EImageColorSpace::Undefined
Key | Value | Comment |
Undefined | 0 | The color space is undefined, or using the color space of an input image data. |
Linear | 1 | The color space is linear (linear gamma). |
sRGB | 2 | The color space is sRGB (nominal gamma of 2.2). |
Syntax
SetColorSpace parameters
Name | Type | Min | Max | Description |
value | EImageColorSpace | | | The value to set ColorSpace to. |
GetColorSpace return value
Type: EImageColorSpace
Default: EImageColorSpace::Undefined
Key | Value | Comment |
EImageColorSpace_Undefined | 0 | The color space is undefined, or using the color space of an input image data. |
EImageColorSpace_Linear | 1 | The color space is linear (linear gamma). |
EImageColorSpace_sRGB | 2 | The color space is sRGB (nominal gamma of 2.2). |
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.
Syntax
SetFilePath parameters
Type | Name | Min | Max | Description |
const char * | value | | | The path of the texture image data file. |
GetFilePath return value
Type: spString
Syntax
SetFilePath parameters
Type | Name | Min | Max | Description |
string | value | | | The path of the texture image data file. |
GetFilePath return value
Type: string
Syntax
SetFilePath parameters
Name | Type | Min | Max | Description |
value | str | | | The path of the texture image data file. |
GetFilePath return value
Type: str
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.
Syntax
SetImageData parameters
Type | Name | Min | Max | Description |
ImageData | value | | | The image data object containing the texture data. |
GetImageData return value
Type: ImageData
Syntax
SetImageData parameters
Type | Name | Min | Max | Description |
ImageData | value | | | The image data object containing the texture data. |
GetImageData return value
Type: ImageData
Syntax
SetImageData parameters
Name | Type | Min | Max | Description |
value | ImageData | | | The image data object containing the texture data. |
GetImageData return value
Type: ImageData
Name
The name of the Texture object. (Inherited from Object)
Syntax
SetName parameters
Type | Name | Min | Max | Description |
const char * | name | | | New name of the object. |
GetName return value
Type: spString
Syntax
SetName parameters
Type | Name | Min | Max | Description |
string | name | | | New name of the object. |
GetName return value
Type: string
Syntax
SetName parameters
Name | Type | Min | Max | Description |
name | str | | | New name of the object. |
GetName return value
Type: str
Methods details
AddObserver
Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)
Syntax
Parameters
Type | Name | Min | Max | Description |
Observer | observer | | | Observer is the object that will receive events. |
Return value
Type: rid
Syntax
Parameters
Type | Name | Min | Max | Description |
Observer | observer | | | Observer is the object that will receive events. |
Return value
Type: int
Syntax
Parameters
Name | Type | Min | Max | Description |
observer | Observer | | | Observer is the object that will receive events. |
Return value
Type: int
Equals
Check for equality against other texture. If the texture is external, this method checks whether the path to the data is equal, otherwise it will compare the embedded image data of this texture.
Syntax
Parameters
Type | Name | Min | Max | Description |
Texture | other | | | The other texture to compare against. |
Return value
Type: bool
Syntax
Parameters
Type | Name | Min | Max | Description |
Texture | other | | | The other texture to compare against. |
Return value
Type: bool
Syntax
Parameters
Name | Type | Min | Max | Description |
other | Texture | | | The other texture to compare against. |
Return value
Type: bool
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.
Syntax
Parameters
Type | Name | Min | Max | Description |
Return value
Type: bool
Syntax
Parameters
Type | Name | Min | Max | Description |
Return value
Type: bool
Syntax
Parameters
Name | Type | Min | Max | Description |
Return value
Type: bool
GetClass
Get the name of the Texture class. (Inherited from Object)
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
IsA
Returns true if Texture is a or is a descendant of the class named as the type parameter. (Inherited from Object)
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | type | | | Name of the class to check if Texture 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 Texture 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 Texture is, or is a descendant of. |
Return value
Type: bool
IsNull
Returns true if the Texture object is invalid. (Inherited from Object)
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
IsSameObjectAs
Returns true if the Texture object is valid. (Inherited from Object)
Syntax
Parameters
Type | Name | Min | Max | Description |
Object | object | | | Object to compare with. |
Return value
Type: bool
Syntax
Parameters
Type | Name | Min | Max | Description |
Object | object | | | Object to compare with. |
Return value
Type: bool
Syntax
Parameters
Name | Type | Min | Max | Description |
object | Object | | | Object to compare with. |
Return value
Type: bool
NonNull
Returns true if the Texture object is valid. (Inherited from Object)
Syntax
Parameters
NonNull takes no parameters.
Return value
Type: bool
Syntax
Parameters
NonNull takes no parameters.
Return value
Type: bool
Syntax
Parameters
NonNull takes no parameters.
Return value
Type: bool
PrintInfo
Prints the content/info of the Texture object to the log. (Inherited from Object)
Syntax
Parameters
PrintInfo takes no parameters.
Syntax
Parameters
PrintInfo takes no parameters.
Syntax
Parameters
PrintInfo takes no parameters.
RemoveObserver
Removes a previously added observer object. (Inherited from Object)
Syntax
Parameters
Type | Name | Min | Max | Description |
rid | observerId | | | ObserverId is the id returned by AddObserver when the observer was added. |
Syntax
Parameters
Type | Name | Min | Max | Description |
int | observerId | | | ObserverId is the id returned by AddObserver when the observer was added. |
Syntax
Parameters
Name | Type | Min | Max | Description |
observerId | int | | | ObserverId is the id returned by AddObserver when the observer was added. |
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)
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 spTexture, and if this is the case, returns the object cast into spTexture. (Inherited from Object)
Syntax
Parameters
Type | Name | Min | Max | Description |
Object | object | | | Object to cast. |
Return value
Type: Texture
Syntax
Parameters
Type | Name | Min | Max | Description |
Object | object | | | Object to cast. |
Return value
Type: Texture
Syntax
Parameters
Name | Type | Min | Max | Description |
object | Object | | | Object to cast. |
Return value
Type: Texture