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.SceneLoaderData

A data class for creating scene loaders. Use RegisterSceneLoaderPlugin to register the plugin.

Note

Before you start writing your own SceneLoaderData plugin, you should read SuperClass before.

class c4d.plugins.SceneLoaderData

SuperClass

NodeData

Methods

SceneLoaderData.Identify(self, node, 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:
  • node (BaseList2D) – The node object.
  • name (str) – The name of the loader.
  • 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. Never call the buffer outside this method!
  • size (int) – The size of the chun for testing this file type.
Return type:

bool

Returns:

True if your plugin recognises this file.

SceneLoaderData.Load(self, node, name, doc, filterflags, error, bt)

Override - Load the file into the document.

Parameters:
  • node (BaseList2D) – The node object.
  • name (str) – The filename of the file to load.
  • doc (BaseDocument) – The document that the selected objects should be loaded into.
  • filterflags (int) – Information about what can be done during this load call.
  • error (None) – Currently not used.
  • bt (None) – Currently not used
Return type:

int

Returns:

The return values, stored in c4d.storage:

FILEERROR_NONE

No error.

FILEERROR_OPEN

Problems opening the file.

FILEERROR_CLOSE

Problems closing the file.

FILEERROR_READ

Problems reading the file.

FILEERROR_WRITE

Problems writing the file.

FILEERROR_SEEK

Problems seeking the file.

FILEERROR_INVALID

Invalid parameter or operation (e.g. writing in read-mode).

FILEERROR_MEMORY

Not enough memory.

FILEERROR_USERBREAK

User break.

FILEERROR_WRONG_VALUE

Other value detected than expected.

FILEERROR_CHUNK_NUMBER

Wrong number of chunks or sub chunks detected.

FILEERROR_VALUE_NO_CHUNK

There was a value without any enclosing START/STOP chunks.

FILEERROR_FILE_END

The file end was reached without finishing reading.

FILEERROR_UNKNOWN_VALUE

Unknown value detected.

Table Of Contents

This Page