c4d.modules.bodypaint.PaintLayerBmp

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

Definition

class c4d.modules.bodypaint. PaintLayerBmp

Inheritance

Members

PaintLayerBmp. ImportFromBaseBitmap ( bmp , usealpha )

Fill the layer bitmap with an imported bitmap.

Parameters:
  • bm ( c4d.bitmaps.BaseBitmap ) – The bitmap to import.
  • usealpha ( bool ) – If True the alpha channel of the bitmap is used, otherwise False .
Return type:

bool

Returns:

True if successful, otherwise False .

PaintLayerBmp. ImportFromBaseBitmapAlpha ( bmp , channel )

Fill the layer bitmap with an imported bitmap.

Parameters:
Return type:

bool

Returns:

True if successful, otherwise False .

PaintLayerBmp. GetBoundingBox ( )

Get the bounding box of the bitmap layer:

d = layer_bmp.GetBoundingBox()
d["x1"], d["y1"], d["y1"], d["y2"]
							
Return type: dict
Returns: The coordinates
PaintLayerBmp. GetPixelCnt ( x , y , cnt , buffer , dstmode , flags )

New in version R16.021.

Reads cnt pixels from ( x , y ) in the bitmap to the buffer with mode dstmode .

Parameters:
  • x ( int ) – The starting X coordinate.
  • y ( int ) – The starting Y coordinate.
  • cnt ( int ) – The number of pixels to get.
  • buffer ( c4d.storage.ByteSeq ) – The destination buffer.
  • dstmode ( int ) –

    The destination 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.
  • flags ( int ) –

    Flags:

    PIXELCNT_0 None.
    PIXELCNT_APPLYALPHA Apply alpha channel.
    PIXELCNT_B3DLAYERS Merge B3D layers ( MultipassBitmap )
    PIXELCNT_DITHERING Allow dithering.
    PIXELCNT_INTERNAL_ALPHAVALUE Private.
    PIXELCNT_INTERNAL_SETLINE Private.
Return type:

bool

Returns:

True if successful, otherwise False .

PaintLayerBmp. SetPixelCnt ( x , y , cnt , buffer , inc , srcmode , flags )

New in version R16.021.

Sets cnt pixels at ( x , y ) in the bitmap from buffer with mode srcmode , incrementing inc bytes for each pixel.

Parameters:
  • x ( int ) – X coordinate of the first pixel to set.
  • y ( int ) – Y coordinate of the first pixel to set.
  • cnt ( int ) – Number of pixels to set.
  • buffer ( c4d.storage.ByteSeq ) – The source buffer.
  • inc ( int ) – The byte increment per pixel in the buffer.
  • srcmode ( int ) –

    The source mode.

    Note

    None of the alpha modes are supported.

    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.
  • flags ( int ) –

    Flags:

    PIXELCNT_0 None.
    PIXELCNT_APPLYALPHA Apply alpha channel.
    PIXELCNT_B3DLAYERS Merge B3D layers ( MultipassBitmap )
    PIXELCNT_DITHERING Allow dithering.
    PIXELCNT_INTERNAL_ALPHAVALUE Private.
    PIXELCNT_INTERNAL_SETLINE Private.
Return type:

bool

Returns:

True if successful, otherwise False .

Table Of Contents