MTextureArguments Class Reference

#include <MTextureManager.h>

Class Description

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

+ Examples:

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

Constructor & Destructor Documentation

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.

Parameters
[in]filePathImage file name
[in]mipmapLevelsMipmap generation levels
  • "mipmapLevels==0" == create and populate all possible levels, using file contents if available
  • "mipmapLevels>1" == create the specified number of levels, using file contents if available
  • "mipmapLevels==1" == no mipmap chain
[in]useExposureControlUse linear exposure control to convert HDR images
[in]layerNameThe name of the layer to load, this is only relevant for PSD files, otherwise it will have no effect
[in]alphaChannelIdxThe index of the alpha channel to load, this is only relevant for PSD files, otherwise it will have no effect

Member Function Documentation

void setContextNodeFullName ( const MString contextNodeFullName)

Set the full name of the texture owner node which is provided as a context to the Maya resolver.

Parameters
[in]contextNodeFullNamefull 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.

Parameters
[in]nodeThe file texture node the texture is associated.

The documentation for this class was generated from the following files:
  • MTextureManager.h
  • MTextureManager.cpp