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.bitmaps.MultipassBitmap – a multipass bitmap class

This is an extension of the BaseBitmap class that supports higher bit depths, even floating point images, and multiple layers.

class c4d.bitmaps.MultipassBitmap

// General

// Add stuff

// Parameter

// count of elements

GetSetter

Methods

MultipassBitmap.__init__(bx, by, mod)

Allocates a multipass bitmap of size bx/by and bit depth given by mode. The first RGBA layer is also created.

Parameters:
  • bx – Width in pixels.
  • bx (int) – Height in pixels.
  • mode (int) –

    Main mode:

    MODE_RGB 8-bit RGB channels.
    MODE_RGBw 16-bit RGB channels.
    MODE_RGBf Floating point RGB channels.

: :rtype: MultipassBitmap :return: The new multipass bitmap.

MultipassBitmap.DeleteLayer(layer)

Deletes layer from the bitmap, freeing the memory.

Parameter:layer (MultipassBitmap) – The layer to delete. Never access this reference afterwards.
Return type:bool
Returns:True if successful, otherwise False.
MultipassBitmap.FindUserID(id[, subid=0])

Finds a layer in the bitmap by ID.

Parameters:
  • id (int) – Main layer ID.
  • subid (int) – Sub ID.
Return type:

MultipassBitmap

Returns:

The found layer or None.

MultipassBitmap.ClearImageData()
Clears the image data for all layers. The layers themselves are not removed or deleted.
MultipassBitmap.GetPaintBitmap()

Gets a paint bitmap.

Return type:PaintBitmap
MultipassBitmap.FreeHiddenLayers()
Free the hidden layers.
MultipassBitmap.AddLayer(insertafter, colormode[, hidden=False])

Adds a layer after insertafter with mode colormode after insertafter in the bitmap.

Parameters:
  • insertafter (MultipassBitmap) – The layer to insert after.
  • colormode (int) –

    Color mode of the new layer.

    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_MASKA 8-bit greymap as mask with 8-bit alpha.
    MODE_GREYw 16-bit greyscale channel.
    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_MASKw 16-bit greymap as mask.
    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.
    MODE_MASKf Floating point greymap as mask.
  • hidden (bool) – If this is True, the layer is hidden.
MultipassBitmap.AddAlpha(insertafter, colormode)

Adds an alpha layer with mode colormode after *insertafter in the bitmap.

Parameters:
  • insertafter (MultipassBitmap) – The layer to insert after.
  • colormode (int) –

    Color mode of the new alpha layer.

    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.
Return type:

MultipassBitmap

Returns:

The added alpha layer or None

MultipassBitmap.AddFolder(insertafter, colormode[, hidden=False])

Adds a folder after insertafter in the bitmap.

Parameters:
  • insertafter (MultipassBitmap) – The layer to insert after.
  • hidden (bool) – If this is True, the layer is hidden.
MultipassBitmap.GetParameter(id)

Uses a description ID as a key into the container, and retrieves the stored data.

Parameter:id (int) –

Parameter ID:

MPB_SHOW bool Determines if this layer will be shown in the external render window. (The CINEMA 4D renderer modifies this value itself.)
MPB_SAVE bool Determines if the layer is saved with the image or not, if SAVEBIT_USESELECTEDLAYERS is used.
MPB_PERCENT float The blend parameter, between 0 and 1.
MPB_BLENDMODE int Blend mode. (LAYER_NORMAL etc. from bplayer.h.)
MPB_COLORMODE int Color mode:
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_MASKA 8-bit greymap as mask with 8-bit alpha.
MODE_GREYw 16-bit greyscale channel.
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_MASKw 16-bit greymap as mask.
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.
MODE_MASKf Floating point greymap as mask.
MPB_BITMAPTYPE int Bitmap type. Cannot be set with SetParameter.
MPB_NAME str Layer name.
MPB_DPI int Resolution in DPI.
MPB_USERID int User ID for the layer. In the renderer this is VPBUFFER_xxx.
MPB_USERSUBID int Sub ID for the layer. In the renderer this is used for blend channels etc.
MPB_FORCEBLEND int Special mode used to force blend layers.
Return type:any
Returns:Depends on the description ID. Can be None.
MultipassBitmap.SetParameter(id, t_data)

Uses a description ID as a key into the container, and stores the specified data.

Parameter:id (list of int) – Description ID.
Return type:any
Returns:Depends on the description ID. Can be None.
MultipassBitmap.GetLayerNum(num)

Gets the layer with number num.

Parameter:num (int) – Layer *index, 0 <= num < MultipassBitmap.GetLayerCount().
Return type:MultipassBitmap
Returns:The retrieved layer, or None if the operation failed.
MultipassBitmap.GetAlphaLayerNum(num)

Gets the alpha layer with number num.

Parameter:num (int) – Alpha layer index, *0 <= num < MultipassBitmap.GetLayerCount().
Return type:MultipassBitmap
Returns:The retrieved layer, or None if the operation failed.
MultipassBitmap.GetHiddenLayerNum(num)

Gets the hidden layer with number num.

Parameter:num (int) – Hidden layer index, *0 <= num < MultipassBitmap.GetLayerCount().
Return type:MultipassBitmap
Returns:The retrieved layer, or None if the operation failed.
MultipassBitmap.GetLayerCount(num)

Retrieves the number of layers in the bitmap. This is the sum of the number of layers, folders and alphas that are direct children of this bitmap.

Return type:int
Returns:Layer count.
MultipassBitmap.GetAlphaLayerCount()

Retrieves the number of alpha layers in the bitmap.

Return type:int
Returns:Alpha layer count.
MultipassBitmap.GetHiddenLayerCount()

Retrieves the number of hidden layers in the bitmap.

Return type:int
Returns:Hidden layer count.

Table Of Contents

This Page