c4d.modules.bodypaint.PaintBitmap

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

Methods Signatures

PaintBitmap.GetBw(self)

Get the width of the paint bitmap.

PaintBitmap.GetBh(self)

Get the height of the paint bitmap.

PaintBitmap.GetPaintTexture(self)

Get the paint texture if possible.

PaintBitmap.GetParent(self)

Get the parent.

PaintBitmap.GetLayerDownFirst(self)

Get the first alpha channel layer.

PaintBitmap.GetLayerDownLast(self)

Get the last child layer.

PaintBitmap.GetAlphaFirst(self)

Get the first alpha channel layer.

PaintBitmap.GetAlphaLast(self)

Get the last alpha channel layer.

PaintBitmap.AddAlphaChannel(self, bitdepth[, prev, ...])

Add an alpha channel to the layer.

PaintBitmap.AskApplyAlphaMask(self)

Check if an alpha mask can be applied.

PaintBitmap.UpdateRefresh(self, xmin, ymin, xmax, ...)

Refresh an area of the paint bitmap.

PaintBitmap.UpdateRefreshAll(self, flags, reallyall)

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

PaintBitmap.GetColorMode(self)

Get the color mode of the paint bitmap.

PaintBitmap.GetDirty(self, flags)

Get dirty count.

Inheritance

Parent Class:

Children Classes:

Methods Documentation

PaintBitmap.GetBw(self)

Get the width of the paint bitmap.

Return type

int

Returns

The width of the paint bitmap.

PaintBitmap.GetBh(self)

Get the height of the paint bitmap.

Return type

int

Returns

The height of the paint bitmap.

PaintBitmap.GetPaintTexture(self)

Get the paint texture if possible.

Return type

c4d.modules.bodypaint.PaintTexture

Returns

The paint texture if possible, otherwise None.

PaintBitmap.GetParent(self)

Get the parent.

Note

This can be a layer or a texture for instance.

Return type

c4d.modules.bodypaint.PaintBitmap

Returns

The paint texture if possible, otherwise None.

PaintBitmap.GetLayerDownFirst(self)

Get the first alpha channel layer.

Return type

c4d.modules.bodypaint.PaintLayer

Returns

The first alpha channel layer, or None if there is none.

PaintBitmap.GetLayerDownLast(self)

Get the last child layer.

Return type

c4d.modules.bodypaint.PaintLayer

Returns

The last child layer, or None if there is none.

PaintBitmap.GetAlphaFirst(self)

Get the first alpha channel layer.

Return type

c4d.modules.bodypaint.PaintLayer

Returns

The first alpha channel layer, or None if there is none.

PaintBitmap.GetAlphaLast(self)

Get the last alpha channel layer.

Return type

c4d.modules.bodypaint.PaintLayer

Returns

The last alpha channel layer, or None if there is none.

PaintBitmap.AddAlphaChannel(self, bitdepth, prev=None, undo=True, activate=True)

Add an alpha channel to the layer.

Parameters
  • bitdepth (int) –

    The bit depth of the alpha channel:

    BITDEPTH_SHIFT

    BITDEPTH_MAXMODES

    BITDEPTH_UCHAR

    BITDEPTH_UWORD

    BITDEPTH_FLOAT

  • prev (c4d.modules.bodypaint.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

c4d.modules.bodypaint.PaintLayerBmp

Returns

The added alpha channel, or None if it failed.

PaintBitmap.AskApplyAlphaMask(self)

Check if an alpha mask can be applied.

Return type

bool

Returns

True if an alpha mask can be applied, otherwise False.

PaintBitmap.UpdateRefresh(self, xmin, ymin, xmax, ymax, flags)

Refresh an area of the paint bitmap.

Note

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:

    UPDATE_CHILDREN

    Private.

    UPDATE_PARENTS

    Private.

    UPDATE_PREVIEW

    Private.

    UPDATE_REFRESH2D

    Private.

    UPDATE_RECALC

    Private.

    UPDATE_NOSAVECHG

    Private.

    UPDATE_NOOFFSET

    Private.

    UPDATE_REFRESH3D

    Private.

    UPDATE_REFRESHCURSOR

    Private.

    UPDATE_NOSTOPTHREADS

    Private.

    UPDATE_STD

    Standard refresh.

PaintBitmap.UpdateRefreshAll(self, flags, reallyall)

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

Parameters
  • flags (int) –

    Flags:

    UPDATE_CHILDREN

    Private.

    UPDATE_PARENTS

    Private.

    UPDATE_PREVIEW

    Private.

    UPDATE_REFRESH2D

    Private.

    UPDATE_RECALC

    Private.

    UPDATE_NOSAVECHG

    Private.

    UPDATE_NOOFFSET

    Private.

    UPDATE_REFRESH3D

    Private.

    UPDATE_REFRESHCURSOR

    Private.

    UPDATE_NOSTOPTHREADS

    Private.

    UPDATE_STD

    Standard refresh.

  • 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(self)

Get the color mode of the paint bitmap.

Return type

int

Returns

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

PaintBitmap.GetDirty(self, flags)

Get dirty count.

Parameters

flags (int) – Reserved, must be 0.

Return type

int

Returns

Dirty count, incremented when the paint bitmap changes.