OpenMayaRender.MTexture Class Reference
Class which includes texture data.
OpenMayaRender.MTexture.__init__ |
( |
| ) |
|
x.__init__(...) initializes x; see help(type(x)) for signature
OpenMayaRender.MTexture.bytesPerPixel |
( |
| ) |
|
bytesPerPixel() -> int
Get the number of bytes per pixel in the texture.
OpenMayaRender.MTexture.freeRawData |
( |
| ) |
|
|
static |
freeRawData(long) -> None
Deallocate system memory - retrieved from rawData().
OpenMayaRender.MTexture.hasAlpha |
( |
| ) |
|
hasAlpha() -> bool
Get whether the texture has an alpha channel.
OpenMayaRender.MTexture.hasTransparentAlpha |
( |
| ) |
|
hasTransparentAlpha() -> bool
Get whether the texture has semi-transparent texels.
OpenMayaRender.MTexture.hasZeroAlpha |
( |
| ) |
|
hasZeroAlpha() -> bool
Get whether the texture has any texels with an alpha value of 0.0.
OpenMayaRender.MTexture.name |
( |
| ) |
|
name() -> string
Get the name of the texture.
OpenMayaRender.MTexture.rawData |
( |
| ) |
|
rawData() -> (long, rowPitch, slicePitch)
Returns a long containing a C++ 'void' pointer which points to the raw data mapped to the texture.
The caller must deallocate the system memory (using freeRawData()) as the texture itself does not keep any references to it.
* rowPitch [OUT] (int) - The row pitch of the data. It represents the number of bytes of one line of the texture data.
* slicePitch [OUT] (int) - The slice pitch of the data. It represents the number of bytes of the whole texture data.
OpenMayaRender.MTexture.resourceHandle |
( |
| ) |
|
resourceHandle() -> long
Returns a long containing a C++ 'void' pointer which points to the texture.
OpenMayaRender.MTexture.setHasAlpha |
( |
| ) |
|
setHasAlpha(bool) -> self
Specify that the texture has an alpha channel.
OpenMayaRender.MTexture.setHasTransparentAlpha |
( |
| ) |
|
setHasTransparentAlpha(bool) -> self
Specify that the texture has texels with an alpha value greater than or equal to 0.0 and less than 1.0.
OpenMayaRender.MTexture.setHasZeroAlpha |
( |
| ) |
|
setHasZeroAlpha(bool) -> self
Specify that the texture has texels with an alpha value of 0.0.
OpenMayaRender.MTexture.textureDescription |
( |
| ) |
|
textureDescription() -> MTextureDescription
Get texture description.
OpenMayaRender.MTexture.update |
( |
| ) |
|
update(pixelData, generateMipMaps, rowPitch=0, region=None) -> self
update(image, generateMipMaps) -> selfupdate(textureNode) -> self
Update the contents of an image with new data.
From pixel data:
* pixelData (void*) - Data to update the texture with.
* generateMipMaps (bool) - Indicate if mip-maps levels for the texture be rebuilt.
* rowPitch (int) The row pitch of the incoming data.
* region (MTextureUpdateRegion) - Texture sub-region to update. If a None is passed in then the input data is assumed to be updating the entire texture.
From an image:
* image (MImage) - Image containing data to update the texture with.
* generateMipMaps (bool) - Indicate if mip-maps levels for the texture be rebuilt.
From a texture node:
* textureNode (MObject) - File texture node