This documentation is for the free plugin Py4D in CINEMA 4D R11.5 and not for the C4DSDK of Python in CINEMA 4D R12. For R12, please visit PluginCafe.com

c4d.modules.bodypaint.PaintBitmap – a paint bitmap class

The abstract base class of all paint classes. Can be a texture, material, layer or mask.

class c4d.modules.bodypaint.PaintBitmap

SuperClass

BaseList2D

Methods

PaintBitmap.GetBw()

Get the width of the paint bitmap.

Return type:int
Returns:The width of the paint bitmap.
PaintBitmap.GetBh()

Get the height of the paint bitmap.

Return type:int
Returns:The height of the paint bitmap.
PaintBitmap.GetPaintTexture()

Get the paint texture if possible.

Return type:PaintTexture
Returns:The paint texture if possible, otherwise None.
PaintBitmap.GetParent()

Get the parent. This can be a layer or a texture for instance.

Return type:PaintTexture
Returns:The paint texture if possible, otherwise None.
PaintBitmap.GetLayerDownFirst()

Get the first alpha channel layer.

Return type:PaintLayer
Returns:The first alpha channel layer, or None if there is none.
PaintBitmap.GetLayerDownLast()

Get the last child layer.

Return type:PaintLayer
Returns:The last child layer, or None if there is none.
PaintBitmap.GetAlphaFirst()

Get the first alpha channel layer.

Return type:PaintLayer
Returns:The first alpha channel layer, or None if there is none.
PaintBitmap.GetAlphaLast()

Get the last alpha channel layer.

Return type:PaintLayer
Returns:The last alpha channel layer, or None if there is none.
PaintBitmap.AddAlphaChannel(bitdepth[, prev=None][, undo=True][, activate=True])

Add an alpha channel to the layer.

Parameters:
  • bitdepth (int) –

    The bit depth of the alpha channel, stored in c4d.bitmaps:

    BITDEPTH_UCHAR UCHAR (8 bit).
    BITDEPTH_UWORD UWORD (16 bit).
    BITDEPTH_FLOAT Float (32 bit).
  • prev (PaintLayer) – Optional point to insert the alpha channel.
  • undo (bool) – True to create an undo on the undo stack, otherwise False.
  • activate (bool) – If True alpha channel will be activated.
Return type:

PaintLayerBmp

Returns:

The added alpha channel, or None if it failed.

PaintBitmap.AskApplyAlphaMask()

Check if an alpha mask can be applied.

Return type:bool
Returns:True if an alpha mask can be applied, otherwise False.
PaintBitmap.UpdateRefresh(xmin, ymin, xmax, ymax, flags)

Refresh an area of the paint bitmap. Must be done after modifying the paint bitmap.

Parameters:
  • xmin (int) – Left coordinate of the refreshed area.
  • ymin (int) – Top coordinate of the refreshed area.
  • xmax (int) – Right coordinate of the refreshed area.
  • ymax (int) – Bottom coordinate of the refreshed area.
  • flags (int) – Flags, stored in c4d.modules.bodypaint:
PaintBitmap.UpdateRefreshAll(flags, reallyall)

Refresh the complete paint bitmap. Has to be done after modifying the paint bitmap.

Parameters:
  • flags (int) – Flags, stored in c4d.modules.bodypaint:
  • reallyall (bool) – If True an infinite bounding box is used for the refresh. If False the bounding box of the layer is used, this is much faster.
PaintBitmap.GetColorMode()

Get the color mode of the paint bitmap.

Return type:

int

Returns:

The color mode, stored in c4d.bitmaps:

MODE_ALPHA

Only 8-bit alpha channel.

MODE_GREY8

8-bit greyscale channel.

MODE_GREYA8

8-bit greyscale channel with 8-bit alpha.

MODE_RGB

8-bit RGB channels.

MODE_RGBA

8-bit RGB channels with 8-bit alpha.

MODE_CMYK

8-bit CMYK channel.

MODE_CMYKA

8-bit CMYK channel with 8-bit alpha.

MODE_MASK

8-bit greymap as mask.

MODE_GREYw

8-bit greymap as mask with 8-bit alpha.

MODE_GREYAw

16-bit greyscale channel with 16-bit alpha.

MODE_RGBw

16-bit RGB channels.

MODE_RGBAw

16-bit RGB channels with 16-bit alpha.

MODE_GREYf

Floating point greyscale channel.

MODE_GREYAf

Floating point greyscale channel with floating point alpha.

MODE_RGBf

Floating point RGB channels.

MODE_RGBAf

Floating point RGB channels with floating point alpha.

PaintBitmap.GetDirty(flags)

Get dirty count.

Parameter:flags (int) – Reserved, must be 0.
Return type:int
Returns:Dirty count, incremented when the paint bitmap changes.

Table Of Contents

This Page