#include <MTextureManager.h>
Class which includes texture arguments.
This class encapsulates the information needed by the MTextureManager to acquire a texture from a file, such as the file path and mipmap levels. Encapsulating the texture information in an object allows you to store the information for easy re-use, and can simplify your texture loading code.
MTextureArgments also accepts a file texture node, which is required if you want to activate background loading for the texture. You can set the file texture node through the MTextureArguments() constructor, or by calling MTextureArguments::setFileTextureNode().
To use this class, call the constructor to create an instance and set it up with the necessary parameters. When you need to get the texture, pass the object in a call to MTextureManager::acquireTexture(const MTextureArgments& args).
Public Member Functions | |
MTextureArguments (const MString &filePath, int mipmapLevels=0, bool useExposureControl=true, const MString &layerName=MString(), int alphaChannelIdx=-1) | |
Create the structure which includes the arguments to acquire a texture from disk. More... | |
void | setContextNodeFullName (const MString &contextNodeFullName) |
Set the full name of the texture owner node which is provided as a context to the Maya resolver. More... | |
void | setFileTextureNode (MObject node) |
Set the file texture node associated with the texture. More... | |
MTextureArguments | ( | const MString & | filePath, |
int | mipmapLevels = 0 , |
||
bool | useExposureControl = true , |
||
const MString & | layerName = MString() , |
||
int | alphaChannelIdx = -1 |
||
) |
Create the structure which includes the arguments to acquire a texture from disk.
[in] | filePath | Image file name |
[in] | mipmapLevels | Mipmap generation levels
|
[in] | useExposureControl | Use linear exposure control to convert HDR images |
[in] | layerName | The name of the layer to load, this is only relevant for PSD files, otherwise it will have no effect |
[in] | alphaChannelIdx | The index of the alpha channel to load, this is only relevant for PSD files, otherwise it will have no effect |
void setContextNodeFullName | ( | const MString & | contextNodeFullName | ) |
Set the full name of the texture owner node which is provided as a context to the Maya resolver.
[in] | contextNodeFullName | full name of the texture owner node to be provided as a context to the Maya resolver. |
void setFileTextureNode | ( | MObject | node | ) |
Set the file texture node associated with the texture.
The node is required to activate the texture background loading.
[in] | node | The file texture node the texture is associated. |