A class for paint textures, can contain layers and may represent channel of a material.
Definition
-
class c4d.modules.bodypaint.PaintTexture
Members
-
PaintTexture.GetFirstLayer()
Get the first layer of the paint texture.
Return type: | PaintLayer |
Returns: | The first layer of the paint texture, or None if there is none. |
-
PaintTexture.GetLastLayer()
Get the last layer of the paint texture.
Return type: | PaintLayer |
Returns: | The last layer of the paint texture, or None if there is none. |
-
PaintTexture.AddLayerBmp([insertafter=None][, layerset=None][, mode=COLORMODE_ARGB][, useundo=True][, activate=True])
Get the paint texture if possible.
Parameters: |
|
Return type: | PaintLayerBmp
|
Returns: | The added bitmap layer.
|
-
PaintTexture.AddLayerFolder([insertafter=None][, insertunder=None][, useundo=True][, activate=True])
Get the paint texture if possible.
Parameters: |
- insertafter (PaintLayer) – The layer insertion point.
- insertunder (PaintLayer) – Parent layer folder.
- useundo (bool) – True to create an undo on the undo stack, otherwise False.
- activate (bool) – Select the layer folder.
|
Return type: | PaintLayerBmp
|
Returns: | The added layer folder.
|
-
PaintTexture.SetActiveLayer(layer, activatetexture[, show=True])
Select a layer.
Parameters: |
- layer (PaintLayer) – The layer to select.
- activatetexture (bool) – Select the texture.
- show (True) – Show the texture.
|
-
PaintTexture.GetActive()
Get the selected layer, or None if there is none.
Return type: | PaintLayer |
Returns: | The selected layer. |
-
PaintTexture.GetLinkLayers(addfolders)
Get linked layers.
Parameters: | addfolders (bool) – If True the layer hierarchy is taken into account (see layer folders), otherwise False. |
Return type: | list of PaintLayer |
Returns: | The list containing the linked layers. |
-
PaintTexture.SetColorMode(newcolormode, doundo)
Change the color mode of the paint texture.
Parameters: |
- newcolormode (int) –
The new color mode:
COLORMODE_ALPHA |
Only 8-bit alpha channel. |
COLORMODE_GRAY8 |
8-bit greyscale channel. |
COLORMODE_AGRAY |
8-bit greyscale channel with 8-bit alpha. |
COLORMODE_RGB |
8-bit RGB channels. |
COLORMODE_ARGB |
8-bit RGB channels with 8-bit alpha. |
COLORMODE_CMYK |
8-bit CMYK channel. |
COLORMODE_ACMYK |
8-bit CMYK channel with 8-bit alpha. |
COLORMODE_MASK |
8-bit greymap as mask. |
COLORMODE_AMASK |
8-bit greymap as mask with 8-bit alpha. |
COLORMODE_ILLEGAL |
Private. |
COLORMODE_GRAYw |
8-bit greymap as mask with 8-bit alpha. |
COLORMODE_AGRAYw |
16-bit greyscale channel with 16-bit alpha. |
COLORMODE_RGBw |
16-bit RGB channels. |
COLORMODE_ARGBw |
16-bit RGB channels with 16-bit alpha. |
COLORMODE_MASKw |
16-bit greymap as mask with 16-bit alpha. |
COLORMODE_ILLEGALf |
Private. |
COLORMODE_GRAYf |
Floating point greyscale channel. |
COLORMODE_AGRAYf |
Floating point greyscale channel with floating point alpha. |
COLORMODE_RGBf |
Floating point RGB channels. |
COLORMODE_ARGBf |
Floating point RGB channels with floating point alpha. |
COLORMODE_MASKf |
Floating point greymap with floating point alpha. |
- doundo (bool) – True to create an undo for changing the color mode, otherwise False.
|
-
PaintTexture.GetFilename()
Get the filename of the paint texture.
Return type: | str |
Returns: | The filename of the paint texture. |
-
PaintTexture.GetLayerCount()
Get the number of layers of the paint texture.
Return type: | int |
Returns: | The number of layers. |
-
PaintTexture.GetAlphaCount()
Get the number of alpha channels of the paint texture.
Return type: | int |
Returns: | The number of alpha channels. |
-
static PaintTexture.CreateNewTexture(path, settings)
Creates a new paint texture.
Parameters: |
|
Return type: | PaintTexture
|
Returns: | The created paint texture if successful, otherwise None.
|
-
static PaintTexture.GetTextureDefaults(channel)
Gets the default texture settings for the passed material channel ID.
Parameters: | path (int) – The material channel ID:
CHANNEL_COLOR |
The color channel of the material. |
CHANNEL_LUMINANCE |
The luminance channel of the material. |
CHANNEL_TRANSPARENCY |
The transparency channel of the material. |
CHANNEL_REFLECTION |
The reflection channel of the material. |
CHANNEL_ENVIRONMENT |
The environment channel of the material. |
CHANNEL_FOG |
The fog channel of the material. |
CHANNEL_BUMP |
The bump channel of the material. |
CHANNEL_ALPHA |
The alpha channel of the material. |
CHANNEL_SPECULAR |
The specular channel of the material. |
CHANNEL_SPECULARCOLOR |
The specular color channel of the material. |
CHANNEL_GLOW |
The glow channel of the material. |
CHANNEL_DISPLACEMENT |
The displacement channel of the material. |
CHANNEL_DIFFUSION |
The diffusion channel of the material. |
|
Return type: | BaseContainer |
Returns: | The default texture settings:
TEXTURE_FILEFORMAT |
int |
File format: |
FILTER_TIF |
TIFF |
FILTER_TGA |
TGA |
FILTER_BMP |
BMP |
FILTER_IFF |
IFF |
FILTER_JPG |
JPEG |
FILTER_PICT |
Mac Pict |
FILTER_PSD |
Photoshop |
FILTER_RLA |
RLA |
FILTER_RPF |
RPF |
FILTER_B3D |
Bodypaint |
FILTER_TIF_B3D |
TIFF B3D |
FILTER_PSB |
Photoshop Big |
FILTER_AVI |
AVI Movie |
FILTER_MOVIE |
Quicktime Movie |
FILTER_QTVRSAVER_PANORAMA |
QTVR Panorama |
FILTER_QTVRSAVER_OBJECT |
QTVR Object |
FILTER_HDR |
HDR |
FILTER_EXR_LOAD |
EXR (Load) |
FILTER_EXR |
EXR |
FILTER_PNG |
PNG |
FILTER_IES |
IES |
FILTER_DPX |
DPX |
TEXTURE_WIDTH |
int |
Texture width. |
TEXTURE_HEIGHT |
int |
Texture height. |
TEXTURE_MODE |
int |
Texture mode (only non-alpha channel modes): |
COLORMODE_ALPHA |
Only 8-bit alpha channel. |
COLORMODE_GRAY8 |
8-bit greyscale channel. |
COLORMODE_AGRAY |
8-bit greyscale channel with 8-bit alpha. |
COLORMODE_RGB |
8-bit RGB channels. |
COLORMODE_ARGB |
8-bit RGB channels with 8-bit alpha. |
COLORMODE_CMYK |
8-bit CMYK channel. |
COLORMODE_ACMYK |
8-bit CMYK channel with 8-bit alpha. |
COLORMODE_MASK |
8-bit greymap as mask. |
COLORMODE_AMASK |
8-bit greymap as mask with 8-bit alpha. |
COLORMODE_ILLEGAL |
Private. |
COLORMODE_GRAYw |
8-bit greymap as mask with 8-bit alpha. |
COLORMODE_AGRAYw |
16-bit greyscale channel with 16-bit alpha. |
COLORMODE_RGBw |
16-bit RGB channels. |
COLORMODE_ARGBw |
16-bit RGB channels with 16-bit alpha. |
COLORMODE_MASKw |
16-bit greymap as mask with 16-bit alpha. |
COLORMODE_ILLEGALf |
Private. |
COLORMODE_GRAYf |
Floating point greyscale channel. |
COLORMODE_AGRAYf |
Floating point greyscale channel with floating point alpha. |
COLORMODE_RGBf |
Floating point RGB channels. |
COLORMODE_ARGBf |
Floating point RGB channels with floating point alpha. |
COLORMODE_MASKf |
Floating point greymap with floating point alpha. |
|
-
static PaintTexture.SetSelected_Texture(bmp, preferred)
Selects a paint texture.
Parameters: |
|
Return type: | bool
|
Returns: | True if successful, otherwise False.
|
-
static PaintTexture.GetSelectedTexture()
Gets the selected paint texture.
Return type: | PaintTexture |
Returns: | The selected paint texture or None if no paint is selected. |