c4d.plugins.BitmapLoaderData¶
-
class
c4d.plugins.
BitmapLoaderData
¶ - A data class for creating bitmap loaders.Use
RegisterBitmapLoaderPlugin()
to register the plugin.See also
Py-Xample plugin example.
Methods Signatures
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. |
|
Override - Load the image file into the bitmap. |
|
Return the ID of the corresponding bitmap saver, if there is one. |
|
Implement this function if you want to support loading movies. |
Inheritance
Parent Class:
Methods Documentation
-
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 (memoryview) – 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)¶ Override - Load the image file into the bitmap.
Warning
Never call any GUI commands in this method. Use the return value to inform the user about the state of the rendering.
- Parameters
name (str) – The filename of the file.
bm (c4d.bitmaps.BaseBitmap) – The bitmap. Please call
BaseBitmap.Init()
orBaseBitmap.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:
IMAGERESULT_OK
Image loaded/created.
IMAGERESULT_NOTEXISTING
Image does not 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
Thread canceled while working.
-
BitmapLoaderData.
GetSaver
(self)¶ Return the ID of the corresponding bitmap saver, if there is one.
- Return type
int
- Returns
The plugin ID of the corresponding
BitmapSaverData
, or None if there is not one.
-
BitmapLoaderData.
GetInformation
(self, name)¶ Implement this function if you want to support loading movies.
- Parameters
name (str) – The name of the file to check.
- Return type
tuple(int, int)
- Returns
The number of frames and fps information for name.