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.plugins.BitmapLoaderData

A data class for creating bitmap loaders. Use RegisterBitmapLoaderPlugin to register the plugin.

class c4d.plugins.BitmapLoaderData

Methods

BitmapLoaderData.Identify(self, name, probe, size)

Override - Identify the file type as one that can be loaded using this plugin. If possible, the file should not be identified through the suffix, but through the probe data.

Parameters:
  • name (str) – The name of the file.
  • probe (buffer) – The start of a small chunk of data from the start of the file for testing this file type. Usually the probe size is 1024 bytes. The buffer is just accessible in this method.
  • size (int) – The size of the chunk for testing this file type.
Return type:

bool

Returns:

True if your plugin recognises this file.

BitmapLoaderData.Load(self, name, bm, frame)

Warning

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

Override - Load the image file into the bitmap.

Parameters:
  • name (str) – The filename of the file.
  • bmp (BaseBitmap) – The bitmap. Please call BaseBitmap.Init() or BaseBitmap.InitWith() before, to initialize the size.
  • frame (int) – The frame number for formats containing multiple images in a file such as Quicktime or AVI.
Return type:

int

Returns:

The return values are stored in c4d.bitmaps:

IMAGE_OK

Image loaded/created.

IMAGE_NOTEXISTING

Image doesn’t exist.

IMAGE_WRONGTYPE

Image has the wrong type.

IMAGE_NOMEM

Not enough memory.

IMAGE_DISKERROR

Disk error.

IMAGE_FILESTRUCT

Invalid file structure.

Table Of Contents

This Page