c4d.plugins.SceneSaverData

class c4d.plugins.SceneSaverData
A data class for creating scene savers.
Use RegisterSceneSaverPlugin() to register the plugin.

Note

Before you start writing your own SceneSaverData plugin, you should read NodeData Management before.

Methods Signatures

SceneSaverData.Save(self, node, name, doc, ...) Override - Save the document.

Inheritance

Parent Class:

Methods Documentation

SceneSaverData.Save(self, node, name, doc, filterflags)

Override - Save the document.

Changed in version R15.057.

Warning

Calling BaseDocument.GetDocumentPath() from a scene saver invoked by SaveDocument() is now consistent with the GUI behavior of the export.
BaseDocument.GetDocumentPath() now always returns the current path of the document instead of the target path of the file to save for all formats (except Cinema 4D (*.c4d) and Cinema 4D XML (*.xml)).
A new document flag DOCUMENT_SAVEDOC_DESTINATIONPATH (only set when saving) can be used in scene savers to get the destination path of the exported file.
Parameters:
  • node (c4d.BaseList2D) – The node object.
  • name (str) – The filename of the file to save.
  • doc (c4d.documents.BaseDocument) – The document that the selected objects should be saved from.
  • filterflags (int) –

    The possible flags are:

    SCENEFILTER_NONE None.
    SCENEFILTER_OBJECTS Load/save objects.
    SCENEFILTER_MATERIALS Load/save materials.
    SCENEFILTER_DIALOGSALLOWED Flag to inform a plugin that a dialog can be displayed. If this flag is not set then no dialogs must be opened.
    SCENEFILTER_PROGRESSALLOWED Flag to inform a plugin that a progress bar can be displayed. The progress bar can be set by calling StatusSetBar().
    SCENEFILTER_MERGESCENE Flag to inform a plugin that this is a merge operation, i.e. the document that is inserted to is an existing scene.
    SCENEFILTER_NONEWMARKERS Objects loaded from disk will keep their markers.
    SCENEFILTER_SAVECACHES For melange export only. Caches of objects will also be written (only supported by Cinema 4D format). This is the same as the global option “Save Polygon Objects for Melange Exchange”.
    SCENEFILTER_NOUNDO Use together with SCENEFILTER_MERGESCENE to avoid that undos are created for the merge operation.
    SCENEFILTER_SAVE_BINARYCACHE Save the binary compiled shaders with the scene (only for Cinema 4D format).
    SCENEFILTER_IDENTIFY_ONLY Do not load the whole document, identify it only.
    SCENEFILTER_ONLY_RENDERDATA Only load render settings. If this flag is set, SCENEFILTER_OBJECTS and SCENEFILTER_MATERIALS are ignored.
    SCENEFILTER_IGNOREMISSINGPLUGINSINNONACTIVERENDERDATA Ignore all missing plugins which are part of a non-active render data.
    SCENEFILTER_IGNOREXREFS

    New in version R16.038: Avoid that included X-Refs will be loaded.

    SCENEFILTER_DONTCORRECTOUTPUTFORMAT Do not change unknown output formats in render settings.
Return type:

int

Returns:

The return values:

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.