c4d.plugins.BitmapSaverData

A data class for creating bitmap savers. Use RegisterBitmapSaverPlugin() to register the plugin.

Note

See Py-Xample plugin example.

Definition

class c4d.plugins. BitmapSaverData

Inheritance

Methods

BitmapSaverData. Edit ( self , data )

Override - Open the settings dialog for this import/export filter.

Parameters: data ( c4d.BaseContainer ) – The settings for your plugin.
Return type: bool
Returns: True if the dialog opened successfully.
BitmapSaverData. Save ( self , fn , bmp , data , savebits )

Warning

Never call any GUI commands in this method. Use the return value to inform the user about the state of the rendering.

Override - Save the bitmap to a file.

Parameters:
  • fn ( str ) – The filename of the file to save.
  • bmp ( c4d.bitmaps.BaseBitmap ) – The bitmap to save the image from.
  • data ( c4d.BaseContainer ) – The settings for your plugin. These settings are stored with the general preferences.
  • savebits ( int ) –

    Flags for the save:

    SAVEBIT_0 No flags.
    SAVEBIT_ALPHA Save the alpha channel(s) in the file. (For filter plugins, do not save an alpha channel if this is not set.)
    SAVEBIT_MULTILAYER Save multiple layers.
    SAVEBIT_USESELECTEDLAYERS Use selected layers.
    SAVEBIT_16BITCHANNELS Use 16 bit channels.
    SAVEBIT_GREYSCALE Save in grayscale mode.
    SAVEBIT_INTERNALNET Private.
    SAVEBIT_DONTMERGE Avoid merging of layers in B3D files.
    SAVEBIT_32BITCHANNELS Use 32 bit channels.
    SAVEBIT_SAVERENDERRESULT Private.
    SAVEBIT_FIRSTALPHA_ONLY Private.
Return type:

int

Returns:

The return values:

IMAGERESULT_OK Image loaded/created.
IMAGERESULT_NOTEXISTING Image doesn`t exist.
IMAGERESULT_WRONGTYPE Image has the wrong type.
IMAGERESULT_OUTOFMEMORY Not enough memory.
IMAGERESULT_FILEERROR File error.
IMAGERESULT_FILESTRUCTURE Invalid file structure.
IMAGERESULT_MISC_ERROR Unknown error.
IMAGERESULT_PARAM_ERROR Parameter error.
IMAGERESULT_THREADCANCELED

New in version R17.032.

Thread canceled while working.

BitmapSaverData. GetMaxAlphas ( self , data )

Get the maximum number of alpha channels this format supports with the current settings.

Parameters: data ( c4d.BaseContainer ) – The settings for your plugin. These settings are stored with the general preferences.
Return type: int
Returns: The number of alpha channels.
BitmapSaverData. GetMaxResolution ( self , layers )

Overload this to return the maximum resolution of the image format.

Parameters: layers ( bool ) – True if layers are to be saved, otherwise False .
Return type: int
Returns: The maximum resolution supported by the image format.

Table Of Contents