Python API 2.0 Reference
OpenMayaRender.MTextureManager Class Reference
+ Inheritance diagram for OpenMayaRender.MTextureManager:

Public Member Functions

def __init__ ()
 
def acquireDepthTexture ()
 
def acquireTexture ()
 
def acquireTiledTexture ()
 
def addImagePath ()
 
def imagePaths ()
 
def releaseTexture ()
 
def saveTexture ()
 

Static Public Member Functions

def __new__ ()
 

Detailed Description

Class which manages texture.

Constructor & Destructor Documentation

def OpenMayaRender.MTextureManager.__init__ ( )
Initialize self.  See help(type(self)) for accurate signature.

Member Function Documentation

def OpenMayaRender.MTextureManager.__new__ ( )
static
Create and return a new object.  See help(type) for accurate signature.
def OpenMayaRender.MTextureManager.acquireDepthTexture ( )
acquireDepthTexture(textureName, image, generateMipMaps=True, normalizationDesc=None) -> MTexture
acquireDepthTexture(textureName, pixelData, width, height, generateMipMaps=True, normalizationDesc=None) -> MTexture

Ask the renderer to acquire a hardware texture.

Acquire a hardware texture from an MImage's depth buffer:
* textureName (string) - Name of the texture to create
* image (MImage) - Contains block of system memory data containing depth map information
* generateMipMaps (bool) - Generate the mipmap levels
* normalizationDesc (MDepthNormalizationDescription) - Optional information to perform normalization on the depth values. Default value is None

Acquire a hardware texture from an array of depth values:
* textureName (string) - Name of the texture to create
* pixelData (float*) - Contains block of system memory data containing depth information
* width (unsigned int) - Width of the texture
* height (unsigned int) - Height of the texture
* generateMipMaps (bool) - Generate the mipmap levels
* normalizationDesc (MDepthNormalizationDescription) - Optional information to perform normalization on the depth values. Default value is None
def OpenMayaRender.MTextureManager.acquireTexture ( )
(Deprecated) acquireTexture(filePath, mipmapLevels=0, layerName="", alphaChannelIdx=-1) -> MTexture
acquireTexture(filePath, contextNodeFullName, mipmapLevels=0, layerName="", alphaChannelIdx=-1) -> MTexture
acquireTexture(textureName, plug, width, height, generateMipMaps=True) -> MTexture
acquireTexture(textureName, textureDesc, pixelData, generateMipMaps=True) -> MTexture
acquireTexture(fileNode, allowBackgroundLoad=False) -> MTexture

Ask the renderer to acquire a hardware texture.

Acquire a hardware texture from an image file:
* filePath (string) - Image file name
* contextNodeFullName (string) Full name of the texture owner Node to be provided as a context to the Maya resolver* mipmapLevels (int) - Mipmap generation levels
* layerName (string) - The name of the layer to load, this is only relevant for PSD files, otherwise it will have no effect
* alphaChannelIdx (int) - The index of the alpha channel to load, this is only relevant for PSD files, otherwise it will have no effect

If a plug to a file texture node is provided then the name, width, height and
generateMipMaps parameters will be ignored as this information will be
based on the image on disk associated with texture node. If uv tiling is
enabled, currently only the first tile will be returned.
Otherwise, an attempt to bake a texture will be made using the Maya's software
renderer convert-to-solid-texture functionality.
* textureName (string) - Name of the texture to create
* plug (MPlug) - Plug which is attached with a texture
* width (int) - Width of the texture
* height (int) - Height of the texture
* generateMipMaps (bool) - Generate the mipmap levels

Acquire a hardware texture by providing a texture description and a block of system memory data which matches the texture description:
* textureName (string) - Name of the texture to create
* textureDesc (MTextureDescription) - Description of the texture
* pixelData (void*) - Block of system memory data which matches the texture description
* generateMipMaps (bool) - Generate the mipmap levels
Acquire the texture associated with a given texture node. Currently only file texture nodes are supported.
If uv tiling is enabled, currently only the first tile will be returned.
* textureNode (MObject) - Node to acquire texture from
* allowBackgroundLoad (bool) - Allow for background texture loading. The default value is false.
def OpenMayaRender.MTextureManager.acquireTiledTexture ( )
acquireTiledTexture(textureName, tilePaths, tilePositions, undefinedColor, width, height) -> [MTexture, failedTilePaths, uvScaleOffset]

Ask the renderer to acquire a tiled hardware texture.

* textureName (string) - Name to give to the texture
* tilePaths (list of strings) - Set of path names to UV tiles
* tilePositions (MFloatArray) - Set of lower left coordinates for each UV tile
* undefinedColor (MColor) - Color to fill tile region with if the image for a given UV tile cannot be acquired
* maxWidth (unsigned int) - Maximum width of the output texture. The value is clamped to a minimum of 256
* maxHeight (unsigned int) - Maximum height of the output texture. The value is clamped to a minimum of 256
* failedTilePaths [OUT] (list of strings) - List of files which were not written to the output texture
* uvScaleOffset [OUT] (MFloatArray) - Transform to map to the uv range of the output texture
def OpenMayaRender.MTextureManager.addImagePath ( )
addImagePath(string) -> self

Adds an additional search path for looking up images on disk.
def OpenMayaRender.MTextureManager.imagePaths ( )
imagePaths() -> list of strings

Get the current set of image search paths.
def OpenMayaRender.MTextureManager.releaseTexture ( )
releaseTexture(MTexture) -> self

Deletes the MTexture and releases the reference to the underlying texture which is held by the MTexture object.
def OpenMayaRender.MTextureManager.saveTexture ( )
saveTexture(MTexture, string) -> self

Ask the renderer to save a hardware texture to disk.