c4d.modules.bodypaint.PaintTexture

class c4d.modules.bodypaint.PaintTexture

A class for paint textures, can contain layers and may represent channel of a material.

Methods Signatures

PaintTexture.GetFirstLayer(self)

Get the first layer of the paint texture.

PaintTexture.GetLastLayer(self)

Get the last layer of the paint texture.

PaintTexture.AddLayerBmp(self[, insertafter, ...])

Add a bitmap layer.

PaintTexture.AddLayerFolder(self[, insertafter, ...])

Add a layer folder.

PaintTexture.SetActiveLayer(self, layer, ...[, show])

Select a layer.

PaintTexture.GetActive(self)

Get the selected layer, or None if there is none.

PaintTexture.GetLinkLayers(self, addfolders)

Get linked layers.

PaintTexture.SetColorMode(self, newcolormode, doundo)

Change the color mode of the paint texture.

PaintTexture.GetFilename(self)

Get the filename of the paint texture.

PaintTexture.GetLayerCount(self)

Get the number of layers of the paint texture.

PaintTexture.GetAlphaCount(self)

Get the number of alpha channels of the paint texture.

PaintTexture.SetColorProfile(self, profile)

Sets the color profile for the paint texture.

PaintTexture.GetColorProfile(self)

Gets the color profile for the paint texture.

Static Methods Signatures

c4d.modules.bodypaint.PaintTexture.CreateNewTexture(path, settings)

Creates a new paint texture.

c4d.modules.bodypaint.PaintTexture.GetTextureDefaults(channel)

Gets the default texture settings for the passed material channel ID.

c4d.modules.bodypaint.PaintTexture.SetSelected_Texture(bmp, preferred)

Selects a paint texture.

c4d.modules.bodypaint.PaintTexture.GetSelectedTexture()

Gets the selected paint texture.

Inheritance

Parent Class:

Methods Documentation

PaintTexture.GetFirstLayer(self)

Get the first layer of the paint texture.

Return type

c4d.modules.bodypaint.PaintLayer

Returns

The first layer of the paint texture, or None if there is none.

PaintTexture.GetLastLayer(self)

Get the last layer of the paint texture.

Return type

c4d.modules.bodypaint.PaintLayer

Returns

The last layer of the paint texture, or None if there is none.

PaintTexture.AddLayerBmp(self, insertafter=None, layerset=None, mode=COLORMODE_ARGB, useundo=True, activate=True)

Add a bitmap layer.

Parameters
  • insertafter (c4d.modules.bodypaint.PaintLayer) – The layer insertion point.

  • layerset (c4d.modules.bodypaint.PaintLayer) – The parent layer folder.

  • mode (int) –

    Mode (should be the same as the paint texture):

    COLORMODE_ILLEGAL

    Illegal 8-bit mode.

    COLORMODE_ALPHA

    Only 8-bit alpha channel.

    COLORMODE_GRAY

    8-bit grayscale channel.

    COLORMODE_AGRAY

    8-bit grayscale 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 grayscale map as mask.

    COLORMODE_AMASK

    8-bit grayscale map as mask with 8-bit alpha.

    COLORMODE_ILLEGALw

    Illegal 16-bit mode.

    COLORMODE_GRAYw

    16-bit grayscale channel.

    COLORMODE_AGRAYw

    16-bit grayscale 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 grayscale map as mask with 16-bit alpha.

    COLORMODE_ILLEGALf

    Illegal 32-bit mode.

    COLORMODE_GRAYf

    32-bit floating point grayscale channel.

    COLORMODE_AGRAYf

    32-bit floating point grayscale channel with floating point alpha.

    COLORMODE_RGBf

    32-bit floating point RGB channels.

    COLORMODE_ARGBf

    32-bit floating point RGB channels with floating point alpha.

    COLORMODE_MASKf

    32-bit floating point grayscale map as mask.

  • useundo (bool) – True to create an undo on the undo stack, otherwise False.

  • activate (bool) – True to select the layer.

Return type

c4d.modules.bodypaint.PaintLayerBmp

Returns

The added bitmap layer.

PaintTexture.AddLayerFolder(self, insertafter=None, insertunder=None, useundo=True, activate=True)

Add a layer folder.

Parameters
Return type

c4d.modules.bodypaint.PaintLayerBmp

Returns

The added layer folder.

PaintTexture.SetActiveLayer(self, layer, activatetexture, show=True)

Select a layer.

Parameters
PaintTexture.GetActive(self)

Get the selected layer, or None if there is none.

Return type

c4d.modules.bodypaint.PaintLayer

Returns

The selected layer.

PaintTexture.GetLinkLayers(self, 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(self, newcolormode, doundo)

Change the color mode of the paint texture.

Parameters
  • newcolormode (int) –

    The new color mode:

    COLORMODE_ILLEGAL

    Illegal 8-bit mode.

    COLORMODE_ALPHA

    Only 8-bit alpha channel.

    COLORMODE_GRAY

    8-bit grayscale channel.

    COLORMODE_AGRAY

    8-bit grayscale 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 grayscale map as mask.

    COLORMODE_AMASK

    8-bit grayscale map as mask with 8-bit alpha.

    COLORMODE_ILLEGALw

    Illegal 16-bit mode.

    COLORMODE_GRAYw

    16-bit grayscale channel.

    COLORMODE_AGRAYw

    16-bit grayscale 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 grayscale map as mask with 16-bit alpha.

    COLORMODE_ILLEGALf

    Illegal 32-bit mode.

    COLORMODE_GRAYf

    32-bit floating point grayscale channel.

    COLORMODE_AGRAYf

    32-bit floating point grayscale channel with floating point alpha.

    COLORMODE_RGBf

    32-bit floating point RGB channels.

    COLORMODE_ARGBf

    32-bit floating point RGB channels with floating point alpha.

    COLORMODE_MASKf

    32-bit floating point grayscale map as mask.

  • doundo (bool) – True to create an undo for changing the color mode, otherwise False.

PaintTexture.GetFilename(self)

Get the filename of the paint texture.

Return type

str

Returns

The filename of the paint texture.

PaintTexture.GetLayerCount(self)

Get the number of layers of the paint texture.

Return type

int

Returns

The number of layers.

PaintTexture.GetAlphaCount(self)

Get the number of alpha channels of the paint texture.

Return type

int

Returns

The number of alpha channels.

PaintTexture.SetColorProfile(self, profile)

Sets the color profile for the paint texture.

New in version R17.048.

Parameters

profile (c4d.bitmaps.ColorProfile) – The color profile to set.

Return type

bool

Returns

True if successful, otherwise False.

PaintTexture.GetColorProfile(self)

Gets the color profile for the paint texture.

New in version R17.048.

Return type

c4d.bitmaps.ColorProfile

Returns

The color profile.

Static Methods Documentation

static c4d.modules.bodypaint.PaintTexture.CreateNewTexture(path, settings)

Creates a new paint texture.

Parameters
  • path (str) – The filename for the paint texture.

  • settings (c4d.BaseContainer) –

    The settings for the texture creation:

    TEXTURE_FILEFORMAT

    int

    File format:

    FILTER_TIF

    TIFF.

    FILTER_TGA

    TGA.

    FILTER_BMP

    BMP.

    FILTER_IFF

    IFF.

    FILTER_JPG

    JPEG.

    FILTER_PICT

    PICT.

    FILTER_PSD

    PSD.

    FILTER_RLA

    RLA.

    FILTER_RPF

    RPF.

    FILTER_B3D

    BodyPaint 3D.

    FILTER_TIF_B3D

    TIFF BodyPaint 3D.

    FILTER_PSB

    PSB.

    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_B3DNET

    BodyPaint 3D NET. Private.

    FILTER_DPX

    DPX.

    FILTER_DDS

    New in version R19: DDS.

    TEXTURE_WIDTH

    int

    Texture width.

    TEXTURE_HEIGHT

    int

    Texture height.

    TEXTURE_MODE

    int

    Texture mode (only non-alpha channel modes):

    TEXTURE_COLOR

    Vector

    Texture color.

    TEXTURE_SAVE_IMMEDIATLY

    bool

    Flag to save immediately, otherwise texture is only created in memory.

Return type

c4d.modules.bodypaint.PaintTexture

Returns

The created paint texture if successful, otherwise None.

static c4d.modules.bodypaint.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 a material.

CHANNEL_LUMINANCE

The luminance channel of a material.

CHANNEL_TRANSPARENCY

The transparency channel of a material.

CHANNEL_REFLECTION

The reflection channel of a material.

CHANNEL_ENVIRONMENT

The environment channel of a material.

CHANNEL_FOG

The fog channel of a material.

CHANNEL_BUMP

The bump channel of a material.

CHANNEL_ALPHA

The alpha channel of a material.

CHANNEL_SPECULAR

The specular channel of a material.

CHANNEL_SPECULARCOLOR

The specular color channel of a material.

CHANNEL_GLOW

The glow channel of a material.

CHANNEL_DISPLACEMENT

The displacement channel of a material.

CHANNEL_DIFFUSION

The diffusion channel of a material.

CHANNEL_NORMAL

The normal channel of a material.

CHANNEL_ANY

An unlabeled plugin channel.

Return type

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

PICT.

FILTER_PSD

PSD.

FILTER_RLA

RLA.

FILTER_RPF

RPF.

FILTER_B3D

BodyPaint 3D.

FILTER_TIF_B3D

TIFF BodyPaint 3D.

FILTER_PSB

PSB.

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_B3DNET

BodyPaint 3D NET. Private.

FILTER_DPX

DPX.

FILTER_DDS

New in version R19: DDS.

TEXTURE_WIDTH

int

Texture width.

TEXTURE_HEIGHT

int

Texture height.

TEXTURE_MODE

int

Texture mode (only non-alpha channel modes):

TEXTURE_COLOR

Vector

Texture color.

TEXTURE_SAVE_IMMEDIATLY

bool

Flag to save immediately, otherwise texture is only created in memory.

static c4d.modules.bodypaint.PaintTexture.SetSelected_Texture(bmp, preferred)

Selects a paint texture.

Parameters
Return type

bool

Returns

True if successful, otherwise False.

static c4d.modules.bodypaint.PaintTexture.GetSelectedTexture()

Gets the selected paint texture.

Return type

c4d.modules.bodypaint.PaintTexture

Returns

The selected paint texture or None if no paint is selected.