Custom register plugin

Hi folks,

just doing some brainstorming and hoping someone may be able to suggest/contribute some ideas.

I have a dialog plugin with a graphical interface. I'd like to be able to register plugins for my plugin, so that I can build them separately if needed, or perhaps so others in the future may be able to.

Is it possible to register a custom plugin type? Or, could I piggyback off one of the Register*() functions and grab the registration in my plugin somewhere?


Not sure what you're after but you can always use a SpecialEventAdd in your "separate" plugin to communicate with your dialog plugin.
Say, for instance, you can register a unique pluginID to use for a handshake message, so your separate plugin can pass its pluginID to the dialog plugin, which would listen to that specific pluginID.

Other solution would be to make use of a "library plugin", providing some sort of API for the separate plugin to communicate with. Or even creating the separate plugin as such library plugin, which your dialog plugin would be calling for specific functionality.

I seem to remember having tried some "library plugin" once in the past ... can't really remember much details, though.

You can create arbitrary plugin hooks using the MAXON API's interface system:

Especially look at registries:

or published objects:

See these examples in maxonsdk.module:

Alternatively, you can register arbitrary node plugins with RegisterNodePlugin().

You could implement your functionality e.g. in the Message() method.

Thanks both of you. I'm still thinking this one through.

@C4DS I hadn't thought of SpecialEventAdd, thanks for the suggestion. This had me looking into, and finding, GePluginMessage(). I'm wondering if I could call this in PluginStart(). This does seem to work. I could maybe avoid Cinema's Register system with this.

@PluginStudent can I register a custom type using GeRegistryAdd()? Or does it have to be one of the listed types? E.g. can I register a type under my main plugin id?


@WickedP said in Custom register plugin:

I have a dialog plugin with a graphical interface. I'd like to be able to register plugins for my plugin, so that I can build them separately if needed, or perhaps so others in the future may be able to.

Hi WickedP!
We are doing something similar in the 3delightForCinema4D renderer plugin. (source available here: We have a custom plugin system, separate from the normal c4d one, that allows 3rd party modules to add functionality to our plugin.

This is handled via the "PluginMessage" function. When c4d has loaded, our plugin sends a special message to all other plugins, and passes along a pointer to a "pluginmanager" structure. Other plugins can then respond to this message, and register their plugins via the pluginmanager. You can see how this works in our source code. Some hints on where to look:

The "API" for our plugin system consists of a few header files, describing the supported plugin types (called "hooks" and "translators"):

Here is the main file of the module that manages plugin loading:

The "PluginMessage" function in this file is where the message to load custom plugins is sent (in response to "C4DPL_STARTACTIVITY".

Here is the main file of an example separate module that registers a number of plugins: Geometry/source/main.cpp

I hope this description is somewhat clear. We have found it to be a really straightforward but powerful way of designing a custom plugin system for c4d! Let me know if you have any questions.

Best regards

You could also create a plugin that registered a C4DLibrary. Then your other plugins would make sure they are initialized after your plugin is by using the plugin startup priorities. Then those other plugins can safely call the library and register themselves with your main plugin via the library. Unfortunately I don't think there is much documentation on this though. This is how I handle my plugin manager, all of my other plugins register themselves with my plugin so that it can deal with licensing etc.. and only allow certain plugins to actually load at startup.

Thanks @Filip and @kbar, I've setup a simple message system that I'm experimenting with.

Just a question (for anyone) regarding the start up procedures for Cinema, will my plugin receive PluginMessage() messages if my main plugin is not registered yet? Asking to make sure I can receive a message from another plugin that Cinema might try to register before mine.


@WickedP yes you can assume it.

Cinema 4D first loads all dlls, then PluginMessage is forwarded to each dlls.