c4d.plugins

Follow me to the Inheritance diagramm.

This document contains classes to create your own plugins. To get information about the plugin structure, check out Plugin Structure.

Functions

Register Functions

c4d.plugins.GeLoadString(id[, p1[, p2[, p3[, p4]]]])

Note

To use this function, __res__ must be defined in your global scope.

Load a string and replace the first ‘#’ with the placeholder string.

In Cinema 4D there is a convention that in strings ‘#’ is a placeholder for dynamic parts (this allows you to translate a whole sentence as sentence structure and word placement may be reverted in other language).

For example: If the string is named: “loading of file ‘#’ failed” then you can pass the actual filename (as string) as p1 and you’ll get the desired result.

Parameters:
  • id (int) – The ID of the string to get.
  • p1 (str) – The string to insert into the first placeholder.
  • p2 (str) – The string to insert into the second placeholder.
  • p3 (str) – The string to insert into the third placeholder.
  • p4 (str) – The string to insert into the fourth placeholder.
Return type:

str

Returns:

The completed string.

c4d.plugins.GetToolData(doc, plugind)

Gets the tool data container for the tool with ID pluginid.

Parameters:
Return type:

c4d.BaseContainer

Returns:

Tool data container.

c4d.plugins.RegisterPluginHelpCallback(pluginid, callback)

New in version R19.

Registers a callback for plugin help support.

Parameters:
  • pluginid (int) – The plugin id. Please obtain a serial from PluginCafe.com
  • callback (function(opType, baseType, group, property)) –
    The help callback for the plugin. Useful to display context sensitive help when the user selects “Show Help” for a node or attribute.
    The passed arguments are:
    opType: str: The node type name, for example “OATOM”.
    baseType: str: The name of the base object type that opType is derived from, usually the same as opType.
    group: str: The name of the group in the attribute manager, for example “ID_OBJECTPROPERTIES”.
    property: str: The name of the property, for example “ATOMOBJECT_SINGLE”.

    The callback function returns True if help has been provided, otherwise False.

    Warning

    Only return True for the registered plugin types.

Return type:

bool

Returns:

True if successful, otherwise False.

c4d.plugins.GetWorldPluginData(id)

Retrieves a container stored with SetWorldPluginData() from the Cinema 4D preferences. This can be used by any plugin to store preferences.

See also

This script that shows how to effectively access and change the settings of an importer/exporter.

Parameters:id (int) – The plugin ID that the container should be associated with.
Return type:c4d.BaseContainer
Returns:The retrieved container
c4d.plugins.SetWorldPluginData(id, bc[, add=False])

Stores a container in the Cinema 4D preferences. Can be used by any plugin to store preferences.

See also

This script that shows how to effectively access and change the settings of an importer/exporter.

Parameters:
  • id (int) – The plugin ID that the container should be associated with. Please use a unique ID from PluginCafe.
  • bc (c4d.BaseContainer) – The container to store.
  • add (bool) – If this is True the container values are merged with the ones currently stored for this ID. Otherwise the previous values are lost.
Return type:

bool

Returns:

True if the container was stored, otherwise False.

c4d.plugins.ReadRegInfo(pluginid, size)

Reads user-specific data (e.g. login data for a user account).

Note

Use this method instead of WritePluginInfo() in a license server environment.

Parameters:
  • pluginid (int) – The plugin ID the data is associated with.
  • size (int) – The buffer size
Return type:

c4d.storage.ByteSeq

Returns:

The data buffer.

c4d.plugins.WriteRegInfo(pluginid, buffer)

Writes user-specific data (e.g. login data for a user account).

Note

Use this method instead of WritePluginInfo() in a license server environment.

Parameters:
  • pluginid (int) – The plugin ID the data is associated with.
  • buffer (c4d.storage.ByteSeq) – The data buffer.
c4d.plugins.ReadPluginInfo(pluginid, size)

Read private serial information for a plugin. Cinema 4D will store this data encrypted.

Parameters:
  • pluginid (int) – The plugin ID the data is associated with.
  • size (int) – The buffer size
Return type:

c4d.storage.ByteSeq

Returns:

The data buffer.

c4d.plugins.WritePluginInfo(pluginid, buffer)

Write private serial information for a plugin. Cinema 4D will store this data encrypted.

Parameters:
  • pluginid (int) – The plugin ID the data is associated with.
  • buffer (c4d.storage.ByteSeq) – The data buffer.
c4d.plugins.GetFirstPlugin()

Returns the first plugin of Cinema 4D.

Return type:c4d.plugins.BasePlugin
Returns:The first plugin.
c4d.plugins.FindPlugin(id[, type=0])

Returns the BasePlugin found by id.

Parameters:
  • id (int) – The plugin id. Please obtain a serial from plugincafe.com
  • type (int) –

    Optionally a plugin type filter:

    PLUGINTYPE_ANY Any.
    PLUGINTYPE_SHADER 2D Shader.
    PLUGINTYPE_MATERIAL 3D Shader.
    PLUGINTYPE_COMMAND Command (menu) plugin.
    PLUGINTYPE_OBJECT Object plugin.
    PLUGINTYPE_TAG Tag plugin.
    PLUGINTYPE_BITMAPFILTER Bitmap filter.
    PLUGINTYPE_VIDEOPOST Videopost effect.
    PLUGINTYPE_TOOL Tool Plugin.
    PLUGINTYPE_SCENEHOOK Scene Hook.
    PLUGINTYPE_NODE Node Plugin.
    PLUGINTYPE_LIBRARY Library.
    PLUGINTYPE_BITMAPLOADER Bitmap loader.
    PLUGINTYPE_BITMAPSAVER Bitmap saver.
    PLUGINTYPE_SCENELOADER Scene loader.
    PLUGINTYPE_SCENESAVER Scene saver.
    PLUGINTYPE_COREMESSAGE Core message.
    PLUGINTYPE_CUSTOMGUI Custom GUI.
    PLUGINTYPE_CUSTOMDATATYPE Custom datatype.
    PLUGINTYPE_RESOURCEDATATYPE Resource datatype.
    PLUGINTYPE_MANAGERINFORMATION Manager information plugin.
    PLUGINTYPE_CTRACK Track plugin.
    PLUGINTYPE_FALLOFF Falloff plugin.
    PLUGINTYPE_PREFS Preference hook.
Return type:

c4d.plugins.BasePlugin

Returns:

The plugin.

c4d.plugins.FilterPluginList(type, sortbyname)

Browses recursively through the plugin list looking for plugin of the specified type. For example, to find all bitmap savers you can write:

dest = plugins.FilterPluginList(c4d.PLUGINTYPE_BITMAPSAVER, True)
Parameters:
  • type (int) –

    Plugin type filter:

    PLUGINTYPE_ANY Any.
    PLUGINTYPE_SHADER 2D Shader.
    PLUGINTYPE_MATERIAL 3D Shader.
    PLUGINTYPE_COMMAND Command (menu) plugin.
    PLUGINTYPE_OBJECT Object plugin.
    PLUGINTYPE_TAG Tag plugin.
    PLUGINTYPE_BITMAPFILTER Bitmap filter.
    PLUGINTYPE_VIDEOPOST Videopost effect.
    PLUGINTYPE_TOOL Tool Plugin.
    PLUGINTYPE_SCENEHOOK Scene Hook.
    PLUGINTYPE_NODE Node Plugin.
    PLUGINTYPE_LIBRARY Library.
    PLUGINTYPE_BITMAPLOADER Bitmap loader.
    PLUGINTYPE_BITMAPSAVER Bitmap saver.
    PLUGINTYPE_SCENELOADER Scene loader.
    PLUGINTYPE_SCENESAVER Scene saver.
    PLUGINTYPE_COREMESSAGE Core message.
    PLUGINTYPE_CUSTOMGUI Custom GUI.
    PLUGINTYPE_CUSTOMDATATYPE Custom datatype.
    PLUGINTYPE_RESOURCEDATATYPE Resource datatype.
    PLUGINTYPE_MANAGERINFORMATION Manager information plugin.
    PLUGINTYPE_CTRACK Track plugin.
    PLUGINTYPE_FALLOFF Falloff plugin.
    PLUGINTYPE_PREFS Preference hook.
  • sortbyname (bool) – If this is True then the found plugins are sorted alphabetically by name.
Return type:

list of BasePlugin

Returns:

The list.

c4d.plugins.RemovePlugin(plug)

Private.

c4d.plugins.RegisterToolPlugin(id, str, info, icon, help, dat)

Registers a ToolData plugin:

PLUGIN_ID = 1234567890
desc = plugins.GeLoadString(MY_TOOL_DESC)
plugins.RegisterToolPlugin(PLUGIN_ID, "MyTool", 0, None, desc, MyTool())
Parameters:
  • id (int) –

    The plugin id. Please obtain a serial from PluginCafe.com

  • str (str) –

    The name.

    Note

    If you want to affect the order that your plugins are displayed in menus you can add #$n as a prefix to this name, where n is a number. Lower numbers are displayed before higher numbers. If you make the name “–” it will show up as a menu separator.

  • info (int) –

    The settings for the plugin. Possible flags are:

    • Plugin General Flags
    PLUGINFLAG_HIDE Hide the plugin.
    PLUGINFLAG_SMALLNODE Create a small node.
    PLUGINFLAG_COFFEE C.O.F.F.E.E. plugin.
    PLUGINFLAG_HIDEPLUGINMENU Hide the plugin’s menu entry.
    PLUGINFLAG_REFRESHALWAYS In 8.5 Cinema 4D uses cached descriptions for higher speed….
    PLUGINFLAG_MESSAGE_SYNCEVENT

    New in version R17.032.

    SyncMessages will also be received by the message plugin.

    • Tool Plugin Flags
    PLUGINFLAG_TOOL_EVALUATEHANDLES Evaluate object handles when tool is active.
    PLUGINFLAG_TOOL_DRAW_MULTIPLANE Draw multiple planes.
    PLUGINFLAG_TOOL_TWEAK Tweak mode supported.
    PLUGINFLAG_TOOL_HIGHLIGHT Hightlighting supported.
    PLUGINFLAG_TOOL_EDITSTATES Edit states supported.
    PLUGINFLAG_TOOL_SNAPSETTINGS Snap settings supported.
    PLUGINFLAG_TOOL_SINGLECLICK Single click tool.
    PLUGINFLAG_TOOL_TWEAK_NO_HIGHLIGHT Tweak mode with no hightlighting.
  • icon (c4d.bitmaps.BaseBitmap) –

    The icon for the command. The bitmap is copied.

    Note

    The icon should be of size 32x32, but will be scaled if needed. It must also be 24 bits and should if possible include an alpha to support pattern backgrounds.

  • help (str) –

    The tool tips and status bar help text for the command.

    Note

    When using strings it is advised to use the string resources files and the GeLoadString() function. This keeps the plugin easy to localise for any language you wish to support and makes full use of the language features of Cinema 4D.

  • dat (c4d.plugins.ToolData) – A data instance for the plugin.
Return type:

bool

Returns:

True if the registration was succesful.

c4d.plugins.RegisterSculptBrushPlugin(id, str, info, icon, help, sculptparams, dat, res)

New in version R16.021.

Registers a SculptBrushToolData plugin.

Parameters:
  • id (int) –

    The plugin id. Please obtain a serial from PluginCafe.com

  • str (str) –

    The name.

    Note

    If you want to affect the order that your plugins are displayed in menus you can add #$n as a prefix to this name, where n is a number. Lower numbers are displayed before higher numbers. If you make the name “–” it will show up as a menu separator.

  • info (int) –

    The settings for the plugin. Possible flags are:

    • Plugin General Flags
    PLUGINFLAG_HIDE Hide the plugin.
    PLUGINFLAG_SMALLNODE Create a small node.
    PLUGINFLAG_COFFEE C.O.F.F.E.E. plugin.
    PLUGINFLAG_HIDEPLUGINMENU Hide the plugin’s menu entry.
    PLUGINFLAG_REFRESHALWAYS In 8.5 Cinema 4D uses cached descriptions for higher speed….
    PLUGINFLAG_MESSAGE_SYNCEVENT

    New in version R17.032.

    SyncMessages will also be received by the message plugin.

    • Tool Plugin Flags
    PLUGINFLAG_TOOL_EVALUATEHANDLES Evaluate object handles when tool is active.
    PLUGINFLAG_TOOL_DRAW_MULTIPLANE Draw multiple planes.
    PLUGINFLAG_TOOL_TWEAK Tweak mode supported.
    PLUGINFLAG_TOOL_HIGHLIGHT Hightlighting supported.
    PLUGINFLAG_TOOL_EDITSTATES Edit states supported.
    PLUGINFLAG_TOOL_SNAPSETTINGS Snap settings supported.
    PLUGINFLAG_TOOL_SINGLECLICK Single click tool.
    PLUGINFLAG_TOOL_TWEAK_NO_HIGHLIGHT Tweak mode with no hightlighting.
    PLUGINFLAG_TOOL_SWITCHACTION

    New in version R17.032.

    Allow the tool to switch to a different tool on modifier.

  • icon (c4d.bitmaps.BaseBitmap) –

    The icon for the command. The bitmap is copied.

    Note

    The icon should be of size 32x32, but will be scaled if needed. It must also be 24 bits and should if possible include an alpha to support pattern backgrounds.

  • help (str) –

    The tool tips and status bar help text for the command.

    Note

    When using strings it is advised to use the string resources files and the GeLoadString() function. This keeps the plugin easy to localise for any language you wish to support and makes full use of the language features of Cinema 4D.

  • sculptparams (c4d.modules.sculpting.SculptBrushParams) – The brush parameters.
  • dat (c4d.modules.sculpting.SculptBrushToolData) – A data instance for the plugin.
  • res (c4d.plugins.GeResource) – The optional resource.
Return type:

bool

Returns:

True if the registration was succesful.

c4d.plugins.RegisterCommandPlugin(id, str, info, icon, help, dat)

Registers a CommandData plugin:

PLUGIN_ID = 1234567890
desc = plugins.GeLoadString(MY_TOOL_DESC)
plugins.RegisterCommandPlugin(PLUGIN_ID, "MyCommand", 0, None, desc, MyCommand())
Parameters:
  • id (int) –

    A unique plugin ID. You must obtain this from PluginCafe.com

  • name (str) –

    The name of the plugin.

    Note

    If you want to affect the order that your plugins are displayed in menus you can add #$n as a prefix to this name, where n is a number. Lower numbers are displayed before higher numbers. If you make the name “–” it will show up as a menu separator.

  • info (int) –

    The settings for the plugin. Possible flags are:

    • Plugin General Flags
    PLUGINFLAG_HIDE Hide the plugin.
    PLUGINFLAG_SMALLNODE Create a small node.
    PLUGINFLAG_COFFEE C.O.F.F.E.E. plugin.
    PLUGINFLAG_HIDEPLUGINMENU Hide the plugin’s menu entry.
    PLUGINFLAG_REFRESHALWAYS In 8.5 Cinema 4D uses cached descriptions for higher speed….
    PLUGINFLAG_MESSAGE_SYNCEVENT

    New in version R17.032.

    SyncMessages will also be received by the message plugin.

    • Command Plugin Flags
    PLUGINFLAG_COMMAND_HOTKEY Command is a hotkey command. Hotkey commands can only work globally.
    PLUGINFLAG_COMMAND_OPTION_DIALOG Command has additional options. The user can access them through a small gadget.
    PLUGINFLAG_COMMAND_STICKY Command is a “sticky” command. This means CommandData.Execute() is called when the user presses an assigned hotkey and when the hotkey is released. Otherwise the command would be called continously.
    PLUGINFLAG_COMMAND_ICONGADGET Command can be dragged into an iconbar and delivers its own dialogs instead of icons.
  • icon (c4d.bitmaps.BaseBitmap) –

    The icon for the command. The bitmap is copied.

    Note

    The icon should be of size 32x32, but will be scaled if needed. It must also be 24 bits and should if possible include an alpha to support pattern backgrounds.

  • help (str) –

    The tool tips and status bar help text for the command.

    Note

    When using strings it is advised to use the string resources files and the GeLoadString() function. This keeps the plugin easy to localise for any language you wish to support and makes full use of the language features of Cinema 4D.

  • dat (c4d.plugins.CommandData) – A data instance for the plugin.
Return type:

bool

Returns:

True if the registration was succesful.

c4d.plugins.RegisterFalloffPlugin(id, str, info, g, description[, res])

Registers a FalloffData plugin:

Parameters:
  • id (int) –

    A unique plugin ID. You must obtain this from PluginCafe.com

  • str (str) –

    The name of the plugin.

    Note

    If you want to affect the order that your plugins are displayed in menus you can add #$n as a prefix to this name, where n is a number. Lower numbers are displayed before higher numbers. If you make the name “–” it will show up as a menu separator.

  • info (int) –

    The settings for the plugin. Possible flags are:

    PLUGINFLAG_HIDE Hide the plugin.
    PLUGINFLAG_SMALLNODE Create a small node.
    PLUGINFLAG_COFFEE C.O.F.F.E.E. plugin.
    PLUGINFLAG_HIDEPLUGINMENU Hide the plugin’s menu entry.
    PLUGINFLAG_REFRESHALWAYS In 8.5 Cinema 4D uses cached descriptions for higher speed….
    PLUGINFLAG_MESSAGE_SYNCEVENT

    New in version R17.032.

    SyncMessages will also be received by the message plugin.

  • g (c4d.plugins.FalloffData) – The class which inherits from FalloffData.
  • description (str) – The name of the description resource file to use for your plugin without .res, for example ofalloff_falloffname. The name has to be unique, i.e. Tdisplay cannot be used for two different descriptions.
  • res (c4d.plugins.GeResource) – The optional resource.
Return type:

bool

Returns:

True if the registration was succesful.

c4d.plugins.RegisterMessagePlugin(id, str, info, dat)

Registers a MessageData plugin:

PLUGIN_ID = 987665431
plugins.RegisterMessagePlugin(PLUGIN_ID, "MyMessagePlugin", 0, MyMessagePlugin())
Parameters:
  • id (int) –

    A unique plugin ID. You must obtain this from PluginCafe.com

  • name (str) –

    The name of the plugin.

    Note

    If you want to affect the order that your plugins are displayed in menus you can add #$n as a prefix to this name, where n is a number. Lower numbers are displayed before higher numbers. If you make the name “–” it will show up as a menu separator.

  • info (int) –

    The settings for the plugin. Possible flags are:

    PLUGINFLAG_HIDE Hide the plugin.
    PLUGINFLAG_SMALLNODE Create a small node.
    PLUGINFLAG_COFFEE C.O.F.F.E.E. plugin.
    PLUGINFLAG_HIDEPLUGINMENU Hide the plugin’s menu entry.
    PLUGINFLAG_REFRESHALWAYS In 8.5 Cinema 4D uses cached descriptions for higher speed….
    PLUGINFLAG_MESSAGE_SYNCEVENT

    New in version R17.032.

    SyncMessages will also be received by the message plugin.

  • dat (c4d.plugins.MessageData) – A data instance for the plugin.
Return type:

bool

Returns:

True if the registration was succesful.

c4d.plugins.RegisterBitmapSaverPlugin(id, str, info, dat, suffix)

Registers a BitmapSaverData plugin:

PLUGIN_ID = 1234567890
desc = plugins.GeLoadString(MY_SAVER_DESC)
RegisterBitmapSaverPlugin(PLUGIN_ID, "MySaver", plugins.PLUGINFLAG_BITMAPSAVER_SUPPORT_8BIT|plugins.PLUGINFLAG_BITMAPSAVER_FORCESUFFIX, MySaver(), ".my")
Parameters:
  • id (int) –

    A unique plugin ID. You must obtain this from PluginCafe.com

  • str (str) –

    The name of the plugin.

    Note

    If you want to affect the order that your plugins are displayed in menus you can add #$n as a prefix to this name, where n is a number. Lower numbers are displayed before higher numbers. If you make the name “–” it will show up as a menu separator.

  • info (int) –

    The settings for the plugin.

    • Plugin General Flags
    PLUGINFLAG_HIDE Hide the plugin.
    PLUGINFLAG_SMALLNODE Create a small node.
    PLUGINFLAG_COFFEE C.O.F.F.E.E. plugin.
    PLUGINFLAG_HIDEPLUGINMENU Hide the plugin’s menu entry.
    PLUGINFLAG_REFRESHALWAYS In 8.5 Cinema 4D uses cached descriptions for higher speed….
    PLUGINFLAG_MESSAGE_SYNCEVENT

    New in version R17.032.

    SyncMessages will also be received by the message plugin.

    • Bitmap Saver Plugin Flags
    PLUGINFLAG_BITMAPSAVER_SUPPORT_8BIT Support 8-bit bitmaps.
    PLUGINFLAG_BITMAPSAVER_SUPPORT_16BIT Support 16-bit bitmaps.
    PLUGINFLAG_BITMAPSAVER_SUPPORT_32BIT Support 32-bit bitmaps.
    PLUGINFLAG_BITMAPSAVER_SUPPORT_8BIT_LAYERS Support 8-bit layered bitmaps
    PLUGINFLAG_BITMAPSAVER_SUPPORT_16BIT_LAYERS Support 16-bit layered bitmaps.
    PLUGINFLAG_BITMAPSAVER_SUPPORT_32BIT_LAYERS Support 32-bit layered bitmaps.
    PLUGINFLAG_BITMAPSAVER_MOVIE Support movies.
    PLUGINFLAG_BITMAPSAVER_ALLOWOPTIONS Flag for Cinema 4D to identify the savers that have “Edit…” enabled.
    PLUGINFLAG_BITMAPSAVER_FORCESUFFIX Ensure that saved files always get the specified suffix.
  • dat (c4d.plugins.BitmapSaverData) – A data instance for the plugin.
  • suffix (str) – The format’s file suffix.
Return type:

bool

Returns:

True if the registration was succesful.

c4d.plugins.RegisterBitmapLoaderPlugin(id, str, info, dat)

Registers a BitmapLoaderData plugin.

Parameters:
  • id (int) –

    A unique plugin ID. You must obtain this from PluginCafe.com

  • str (str) –

    The name of the plugin.

    Note

    If you want to affect the order that your plugins are displayed in menus you can add #$n as a prefix to this name, where n is a number. Lower numbers are displayed before higher numbers. If you make the name “–” it will show up as a menu separator.

  • info (int) –

    The settings for the plugin. Possible flags are:

    • Plugin General Flags
    PLUGINFLAG_HIDE Hide the plugin.
    PLUGINFLAG_SMALLNODE Create a small node.
    PLUGINFLAG_COFFEE C.O.F.F.E.E. plugin.
    PLUGINFLAG_HIDEPLUGINMENU Hide the plugin’s menu entry.
    PLUGINFLAG_REFRESHALWAYS In 8.5 Cinema 4D uses cached descriptions for higher speed….
    PLUGINFLAG_MESSAGE_SYNCEVENT

    New in version R17.032.

    SyncMessages will also be received by the message plugin.

    • Bitmap Loader Plugin Flags
    PLUGINFLAG_BITMAPLOADER_MOVIE Support movies.
  • dat (c4d.plugins.BitmapLoaderData) – A data instance for the plugin.
Return type:

bool

Returns:

True if the registration was succesful.

c4d.plugins.RegisterTagPlugin(id, str, info, g, description, icon[, disklevel=0][, res])

Note

To use this function, __res__ must be defined in your global scope.

Registers a TagData plugin:

dir, file = os.path.split(__file__)
bmp = c4d.bitmaps.BaseBitmap()
bmp.InitWith(os.path.join(dir, "res", "image_name.tif"))
plugins.RegisterTagPlugin(id=PLUGIN_ID, str="MyTag", g=MyTag,
                          description="your_identifier", icon=bmp,
                          info=c4d.TAG_MULTIPLE|c4d.TAG_EXPRESSION|c4d.TAG_VISIBLE)
Parameters:
  • id (int) –

    A unique plugin ID. You must obtain this from PluginCafe.com

  • str (str) –

    The name of the plugin.

    Note

    If you want to affect the order that your plugins are displayed in menus you can add #$n as a prefix to this name, where n is a number. Lower numbers are displayed before higher numbers. If you make the name “–” it will show up as a menu separator.

  • info (int) –

    The settings for the plugin. Possible flags are:

    • Plugin General Flags
    PLUGINFLAG_HIDE Hide the plugin.
    PLUGINFLAG_SMALLNODE Create a small node.
    PLUGINFLAG_COFFEE C.O.F.F.E.E. plugin.
    PLUGINFLAG_HIDEPLUGINMENU Hide the plugin’s menu entry.
    PLUGINFLAG_REFRESHALWAYS In 8.5 Cinema 4D uses cached descriptions for higher speed….
    PLUGINFLAG_MESSAGE_SYNCEVENT

    New in version R17.032.

    SyncMessages will also be received by the message plugin.

    • Tag Plugin Flags
    TAG_VISIBLE The tag can be seen in the object manager.
    TAG_MULTIPLE Multiple copies of the tag allowed on a single object.
    TAG_HIERARCHICAL The tag works hierarchical, so that sub-objects inherit its properties (e.g. the material tag).
    TAG_EXPRESSION The tag is an expression.
    TAG_TEMPORARY Private.
    TAG_ADDTOTAKEGROUP

    New in version R17.032.

    The tag is added to the Take override groups system.

  • g (any) – The class which inherits from TagData
  • description (str) – The name of the description resource file to use for your plugin without .res, for example Ttagname. The name has to be unique, i.e. Tdisplay cannot be used for two different descriptions.
  • icon (c4d.bitmaps.BaseBitmap) –

    The icon for the command. Can be None. The bitmap is copied.

    Note

    The icon should be of size 32x32, but will be scaled if needed. It must also be 24 bits and should if possible include an alpha to support pattern backgrounds.

  • disklevel (int) –

    The plugin level is similar to a version number for your settings. The default level is 0, you can then increase this for new revisions of your plugin, this allows for forward and backward compatibility.

    As an example you may have updated your plugin, if you now need to write additional information for new settings or changed types for old settings you can increase the level. During loading either a 0 is passed (if the file was written using your old plugin) or 1 (if the file was written by the new plugin). This allows you to easily save/read new values.

    Important

    For forward and backward compatibility to work you must not change any existing read order from a given level, Cinema 4D will skip any new settings automatically if they have not been read for your plugin.

    Note

    If you only use containers for all your values, you do not have to deal with the disklevel.

  • res (c4d.plugins.GeResource) – The optional resource.
Return type:

bool

Returns:

True if the registration was succesful.

c4d.plugins.RegisterShaderPlugin(id, str, info, g, description[, disklevel][, res])

Registers a ShaderData plugin.

Parameters:
  • id (int) –

    A unique plugin ID. You must obtain this from PluginCafe.com

  • str (str) –

    The name of the plugin.

    Note

    If you want to affect the order that your plugins are displayed in menus you can add #$n as a prefix to this name, where n is a number. Lower numbers are displayed before higher numbers. If you make the name “–” it will show up as a menu separator.

  • info (int) –

    One of the following flags:

    PLUGINFLAG_HIDE Hide the plugin.
    PLUGINFLAG_SMALLNODE Create a small node.
    PLUGINFLAG_COFFEE C.O.F.F.E.E. plugin.
    PLUGINFLAG_HIDEPLUGINMENU Hide the plugin’s menu entry.
    PLUGINFLAG_REFRESHALWAYS In 8.5 Cinema 4D uses cached descriptions for higher speed….
    PLUGINFLAG_MESSAGE_SYNCEVENT

    New in version R17.032.

    SyncMessages will also be received by the message plugin.

  • g (any) – The class which inherits from ShaderData
  • description (str) – The name of the description resource file to use for your plugin without .res, for example “Xshadername”. The name has to be unique, i.e. “Tdisplay” cannot be used for two different descriptions.
  • disklevel (int) –

    The plugin level is similar to a version number for your settings. The default level is 0, you can then increase this for new revisions of your plugin, this allows for forward and backward compatibility.

    As an example you may have updated your plugin, if you now need to write additional information for new settings or changed types for old settings you can increase the level. During loading either a 0 is passed (if the file was written using your old plugin) or 1 (if the file was written by the new plugin). This allows you to easily save/read new values.

    Important

    For forward and backward compatibility to work you must not change any existing read order from a given level, Cinema 4D will skip any new settings automatically if they have not been read for your plugin.

    Note

    If you only use containers for all your values, you do not have to deal with the disklevel.

  • res (c4d.plugins.GeResource) – The optional resource.
Return type:

bool

Returns:

True if the registration was succesful.

c4d.plugins.RegisterObjectPlugin(id, str, g, description, info, icon[, disklevel][, res][, groupname[, group]])

Note

To use this function, __res__ must be defined in your global scope.

Registers an ObjectData plugin.

Parameters:
  • id (int) –

    A unique plugin ID. You must obtain this from PluginCafe.com

  • str (str) –

    The name of the plugin.

    Note

    If you want to affect the order that your plugins are displayed in menus you can add #$n as a prefix to this name, where n is a number. Lower numbers are displayed before higher numbers. If you make the name “–” it will show up as a menu separator.

  • g (any) – The class which inherits from ObjectData
  • description (str) – The name of the description resource file to use for your plugin without .res, for example Oobjectname. The name has to be unique, i.e. Tdisplay cannot be used for two different descriptions.
  • info (int) –

    One of the following flags:

    • Plugin General Flags
    PLUGINFLAG_HIDE Hide the plugin.
    PLUGINFLAG_SMALLNODE Create a small node.
    PLUGINFLAG_COFFEE C.O.F.F.E.E. plugin.
    PLUGINFLAG_HIDEPLUGINMENU Hide the plugin’s menu entry.
    PLUGINFLAG_REFRESHALWAYS In 8.5 Cinema 4D uses cached descriptions for higher speed….
    PLUGINFLAG_MESSAGE_SYNCEVENT

    New in version R17.032.

    SyncMessages will also be received by the message plugin.

    • Object Plugin Flags
    OBJECT_MODIFIER Modifier object. Deforms the surrounding object. (E.g. bend.)
    OBJECT_HIERARCHYMODIFIER Hierarchical modifier. Deforms the surrounding objects together with other instances in a hierarchy chain. Only the top-most instance of the plugin in a chain is called. (E.g. bones.)
    OBJECT_GENERATOR Generator object. Produces a polygonal or spline representation on its own. (E.g. primitive cube.)
    OBJECT_INPUT Used in combination with OBJECT_GENERATOR. Specifies that the generator uses builds a polygon or spline, using its subobjects as input. (E.g. Sweep Subdivision Surface, Boolean.)
    OBJECT_PARTICLEMODIFIER Particle modifier.
    OBJECT_ISSPLINE The object is a spline.
    OBJECT_USECACHECOLOR If this flag is specified, the generator object itself controls the objects’ colors (the ones that determine the wireframe/shaded color). Normally these are automatically overwritten by the generator objects settings. E.g. if the instance object is set to green, automatically all of its cache objects get the green color. By setting this flag an instance object could individually color objects.
    OBJECT_CAMERADEPENDENT Camera dependent.
    OBJECT_POINTOBJECT Point Object.
    OBJECT_POLYGONOBJECT Polygon object.
    OBJECT_NO_PLA Objects derived from PointObject will not use auto-keyframing (e.g. Joints can contain points and PLA auto-keyframing is not useful for them)
    OBJECT_DONTFREECACHE Objects’ (generators) caches will not be be deleted - users must maintain caches themselves.
    OBJECT_CALL_ADDEXECUTION Must be set to call ObjectData.Execute() in the priority pipeline specified by ObjectData.AddToExecution().
  • icon (c4d.bitmaps.BaseBitmap) –

    The icon for the command. Can be None. The bitmap is copied.

    Note

    The icon should be of size 32x32, but will be scaled if needed. It must also be 24 bits and should if possible include an alpha to support pattern backgrounds.

  • res (c4d.plugins.GeResource) – The optional resource.
  • disklevel (int) –

    The plugin level is similar to a version number for your settings. The default level is 0, you can then increase this for new revisions of your plugin, this allows for forward and backward compatibility.

    As an example you may have updated your plugin, if you now need to write additional information for new settings or changed types for old settings you can increase the level. During loading either a 0 is passed (if the file was written using your old plugin) or 1 (if the file was written by the new plugin). This allows you to easily save/read new values.

    Important

    For forward and backward compatibility to work you must not change any existing read order from a given level, Cinema 4D will skip any new settings automatically if they have not been read for your plugin.

    Note

    If you only use containers for all your values, you do not have to deal with the disklevel.

  • group (int) – If you will develop more plugins in the future, you can use this optional argument to group all plugins. Obtain an id from plugincafe.com and put this ID to all plugins which you want to group in your own menu.
  • groupname (str) – If the argument group is given, you should pass a string for the groupname. If the groupname between all grouped plugins is different, the first one is used. If no groupname in the grouped plugins was found, ‘#naname: id’ is used. do not use more than 18 chars.
Return type:

bool

Returns:

True if the registration was succesful.

c4d.plugins.RegisterNodePlugin(id, str, info, g, icon[, disklevel])

Registers a NodeData plugin.

Note

Normally you won’t use this function directly, but rather the specific registration functions for each NodeData child class.

Parameters:
  • id (int) –

    A unique plugin ID. You must obtain this from PluginCafe.com

  • str (str) –

    The name of the plugin.

    Note

    If you want to affect the order that your plugins are displayed in menus you can add #$n as a prefix to this name, where n is a number. Lower numbers are displayed before higher numbers. If you make the name “–” it will show up as a menu separator.

  • info (int) –

    One of the following flags:

    PLUGINFLAG_HIDE Hide the plugin.
    PLUGINFLAG_SMALLNODE Create a small node.
    PLUGINFLAG_COFFEE C.O.F.F.E.E. plugin.
    PLUGINFLAG_HIDEPLUGINMENU Hide the plugin’s menu entry.
    PLUGINFLAG_REFRESHALWAYS In 8.5 Cinema 4D uses cached descriptions for higher speed….
    PLUGINFLAG_MESSAGE_SYNCEVENT

    New in version R17.032.

    SyncMessages will also be received by the message plugin.

  • g (any) – The class which inherits from NodeData
  • icon (c4d.bitmaps.BaseBitmap) –

    The icon for the command. Can be None. The bitmap is copied.

    Note

    The icon should be of size 32x32, but will be scaled if needed. It must also be 24 bits and should if possible include an alpha to support pattern backgrounds.

  • disklevel (int) –

    The plugin level is similar to a version number for your settings. The default level is 0, you can then increase this for new revisions of your plugin, this allows for forward and backward compatibility.

    As an example you may have updated your plugin, if you now need to write additional information for new settings or changed types for old settings you can increase the level. During loading either a 0 is passed (if the file was written using your old plugin) or 1 (if the file was written by the new plugin). This allows you to easily save/read new values.

    Important

    For forward and backward compatibility to work you must not change any existing read order from a given level, Cinema 4D will skip any new settings automatically if they have not been read for your plugin.

    Note

    If you only use containers for all your values, you do not have to deal with the disklevel.

Return type:

bool

Returns:

True if the registration was succesful.

c4d.plugins.RegisterPreferencePlugin(id, g, name, description, parentid, sortid)

New in version R19.

Registers a new preference in the Cinema 4D preferences dialog.

Parameters:
  • id (int) –

    A unique plugin ID. You must obtain this from PluginCafe.com

  • g (any) – The class which inherits from PreferenceData
  • name (str) – The name of the preference.
  • description (str) – The name of the description resource file to use for your plugin without .res, for example Oobjectname. The name has to be unique, i.e. Tdisplay cannot be used for two different descriptions.
  • parentid (int) – The ID of the preference parent hook. Should be usually set to 0.
  • sortid (int) –

    The ID of the parent category in the preferences tree or 0 to create a top-level category. The internal categories are:

    PREFS_PRI_COMMON Common
    PREFS_PRI_DOCUMENT Document
    PREFS_PRI_INTERFACE Interface
    PREFS_PRI_THEME Theme
    PREFS_PRI_MOUSE Mouse
    PREFS_PRI_OPENGL OpenGL
    PREFS_PRI_VIEWPORT Viewport
    PREFS_PRI_FILES Files
    PREFS_PRI_UNITS Units
    PREFS_PRI_MEMORY Memory
    PREFS_PRI_INTERNET Internet
    PREFS_PRI_RENDER Render
    PREFS_PRI_BODYPAINT3D Bodypaint 3D
    PREFS_PRI_MODULES Modules
    PREFS_PRI_IMEXPORT Im/Export
    PREFS_PRI_ADVANCED Advanced
    PREFS_PRI_NET NET
c4d.plugins.RegisterManagerInformation(id, str, info)

Registers manager information for use when registering shortcuts with AddShortcut().

Parameters:
  • id (int) –

    A unique plugin ID. You must obtain this from PluginCafe.com

  • str (str) – Manager name.
  • info (int) –

    The settings for the plugin. Possible flags are:

    PLUGINFLAG_HIDE Hide the plugin.
    PLUGINFLAG_SMALLNODE Create a small node.
    PLUGINFLAG_COFFEE C.O.F.F.E.E. plugin.
    PLUGINFLAG_HIDEPLUGINMENU Hide the plugin’s menu entry.
    PLUGINFLAG_REFRESHALWAYS In 8.5 Cinema 4D uses cached descriptions for higher speed….
    PLUGINFLAG_MESSAGE_SYNCEVENT

    New in version R17.032.

    SyncMessages will also be received by the message plugin.

Return type:

bool

Returns:

True if the registration was succesful.

c4d.plugins.RegisterSceneLoaderPlugin(id, str, g, info, description[, res])

Note

To use this function, __res__ must be defined in your global scope.

Registers a SceneLoaderData plugin.

Parameters:
  • id (int) –

    The plugin id. Please obtain a serial from PluginCafe.com

  • str (str) –

    The name of the plugin.

    Note

    If you want to affect the order that your plugins are displayed in menus you can add #$n as a prefix to this name, where n is a number. Lower numbers are displayed before higher numbers. If you make the name “–” it will show up as a menu separator.

  • g (any) – The class which inherits from SceneLoaderData
  • info (int) –

    The settings for the plugin. Possible flags are:

    • Plugin General Flags
    PLUGINFLAG_HIDE Hide the plugin.
    PLUGINFLAG_SMALLNODE Create a small node.
    PLUGINFLAG_COFFEE C.O.F.F.E.E. plugin.
    PLUGINFLAG_HIDEPLUGINMENU Hide the plugin’s menu entry.
    PLUGINFLAG_REFRESHALWAYS In 8.5 Cinema 4D uses cached descriptions for higher speed….
    PLUGINFLAG_MESSAGE_SYNCEVENT

    New in version R17.032.

    SyncMessages will also be received by the message plugin.

    • Scene Loader Plugin Flags
    PLUGINFLAG_SCENELOADER_MERGEORIGINAL If this flag is set, the original (existing) document will be passed to the scene loader instead of a new (empty) one. This allows the importer to change existing data, merge data or to make other modifications based on the existing scene.
    • Scene Filter Plugin Flags
    PLUGINFLAG_SCENEFILTER_DIALOGCONTROL By default the scene loader/saver displays its own description dialog during importing/exporting of scene files. By setting this flag it will surpress this behaviour allowing to display another extended dialog for example.
  • description (str) – The name of the description resource file to use for your plugin without .res, for example Ffiltername. The name has to be unique, i.e. Tdisplay cannot be used for two different descriptions.
  • res (c4d.plugins.GeResource) – The optional resource.
Return type:

bool

Returns:

True if the registration was succesful.

c4d.plugins.RegisterSceneSaverPlugin(id, str, g, info, description, suffix[, res])

Note

To use this function, __res__ must be defined in your global scope.

Registers a SceneSaverData plugin.

Parameters:
  • id (int) –

    The plugin id. Please obtain a serial from PluginCafe.com

  • str (str) –

    The name of the plugin.

    Note

    If you want to affect the order that your plugins are displayed in menus you can add #$n as a prefix to this name, where n is a number. Lower numbers are displayed before higher numbers. If you make the name “–” it will show up as a menu separator.

  • g (any) – The class which inherits from SceneSaverData
  • info (int) –

    The flags are

    • Plugin General Flags
    PLUGINFLAG_HIDE Hide the plugin.
    PLUGINFLAG_SMALLNODE Create a small node.
    PLUGINFLAG_COFFEE C.O.F.F.E.E. plugin.
    PLUGINFLAG_HIDEPLUGINMENU Hide the plugin’s menu entry.
    PLUGINFLAG_REFRESHALWAYS In 8.5 Cinema 4D uses cached descriptions for higher speed….
    PLUGINFLAG_MESSAGE_SYNCEVENT

    New in version R17.032.

    SyncMessages will also be received by the message plugin.

    • Scene Filter Plugin Flags
    PLUGINFLAG_SCENEFILTER_DIALOGCONTROL By default the scene loader/saver displays its own description dialog during importing/exporting of scene files. By setting this flag it will surpress this behaviour allowing to display another extended dialog for example.
  • description (str) – The name of the description resource file to use for your plugin without .res, for example Ffiltername. The name has to be unique, i.e. Tdisplay cannot be used for two different descriptions.
  • suffix (str) – The format’s file suffix.
  • res (c4d.plugins.GeResource) – The optional resource.
Return type:

bool

Returns:

True if the registration was succesful.

c4d.plugins.RegisterDescription(id, str[, res])

New in version R16.021.

Registers a description for a plugin ID.

Note

Not needed for plugin types whose Register() functions have a description parameter.

Parameters:
  • id (int) – The plugin ID. If this is a standalone description, use a unique ID.
  • str (str) –
    The name of the description resource file to use for your plugin without .res extension, for example “registered”.
    The name has to be unique, i.e. Tdisplay cannot be used for two different descriptions.
  • res (c4d.plugins.GeResource) – Pass to search in a specific resource class. Otherwise the default path is used.
Return type:

bool

Returns:

True if the registration was succesful.