一般插件信息手册
Custom plugin classes are added to Cinema 4D using plugin hooks. A plugin class is derived from a base class and implements its virtual functions.
This is how a typical plugin class looks like:
// A simple example generator object plugin class.
SUPER
macro to call functions of the base class.
Cinema 4D has to be informed about the new plugin class. This is typically done using a "Register" function. Examples are:
Such "Register" functions are typically used in a plugin's PluginStart() 函数。见 PluginStart .
RegisterObjectPlugin (123456, "Example Generator" , OBJECT_GENERATOR , ExampleGenerator::Alloc, "Oexamplegenerator" , nullptr , 0);The arguments of a "Register" function vary from type to type but usually are:
nullptr
is handed over for no icon. A
BaseBitmap
for the icon can easily be loaded with
AutoBitmap
.
These flags can be used in the "Register" function of all NodeData based plugin classes:
ShaderData plugins can be placed in the "Effects" or "Surfaces" submenu, MaterialData plugins can be placed in the "Shaders" menu. To place them there the category name has to be added to the plugin name that is used with the "Register" function.
Many plugin classes are based on NodeData . But typical Cinema 4D classes are based on C4DAtom , GeListNode and BaseList2D 。 NodeData based plugin class is used as the "core" of such C4DAtom based class and implements its functionality.
The NodeData "core" can be obtained from objects and within a NodeData based plugin class it is possible to get the corresponding GeListNode .
For convenience the corresponding GeListNode is also handed over in the virtual functions of NodeData .
The corresponding functions are: