c4d_fieldplugin.h File Reference

Classes

class   FieldData
class   FieldLayerData

函数

Bool   RegisterFieldPlugin ( Int32 id, const maxon::String &name, const maxon::String &help, Int32 info, DataAllocator *g, const maxon::String &description, BaseBitmap *icon, Int32 disklevel)
Bool   RegisterFieldLayerPlugin ( Int32 id, const maxon::String &name, const maxon::String &help, const maxon::String &pickInstruction, Int32 info, DataAllocator *g, const maxon::String &description, BaseBitmap *icon, Int32 disklevel, FieldLayerAcceptDragFunction *dragFunc=nullptr)

Function Documentation

◆  RegisterFieldPlugin()

Bool RegisterFieldPlugin ( Int32   id ,
const maxon::String name ,
const maxon::String help ,
Int32   info ,
DataAllocator g ,
const maxon::String description ,
BaseBitmap icon ,
Int32   disklevel  
)

Registers a FieldObject plugin

参数
[in] id A unique plugin ID. Must be obtained from http://www.plugincafe.com .
[in] name The name of the plugin.
To affect the order that plugins are displayed in menus add "#$n" as a prefix to this name, where n is a number.
Lower numbers are displayed before higher numbers. If name is "--" it will show up as a menu separator.
[in] help The help displayed on mouse hover over this FieldLayers icon.
[in] info The field plugin info flags: PLUGINFLAG OBJECT PLUGINFLAG
[in] g The allocator for the object plugin. This is a pointer to a function that creates a new instance of FieldData with NewObj() .
[in] description The name of the description resource file to use for the object plugin without .res extension, for example "Fobjectname" .
The name has to be unique, i.e. "Tdisplay" cannot be used for 2 different descriptions. See 描述 Resource for more information.
[in] icon The icon for the object. The bitmap is copied.
The icon should be of size 32x 32 , but will be scaled if needed.
It must also be 24 bits and should if possible include an alpha to support pattern backgrounds.
[in] disklevel The plugin level is similar to a version number. The default level is 0 .
Increase this for new revisions of a plugin to allow for forward and backward compatibility.

As an example you may have updated a plugin. If you now need to write additional information for new settings or changed types for old settings increase the level.
During loading either a 0 is passed (if the file was written by the old plugin) or 1 (if the file was written by the new plugin). This allows to easily write/read new values.
For forward and backward compatibility to work any existing read order from a given level must not be changed. Cinema 4D skips any new settings automatically if they have not been read.

disklevel is only useful if variables are written/read in NodeData::Write / NodeData::Read .
返回
true if the object plugin was registered, otherwise false .

◆  RegisterFieldLayerPlugin()

Bool RegisterFieldLayerPlugin ( Int32   id ,
const maxon::String name ,
const maxon::String help ,
const maxon::String pickInstruction ,
Int32   info ,
DataAllocator g ,
const maxon::String description ,
BaseBitmap icon ,
Int32   disklevel ,
FieldLayerAcceptDragFunction *  dragFunc = nullptr  
)

Registers a FieldLayer plugin

参数
[in] id A unique plugin ID. Must be obtained from http://www.plugincafe.com .
[in] name The name of the plugin.
To affect the order that plugins are displayed in menus add "#$n" as a prefix to this name, where n is a number.
Lower numbers are displayed before higher numbers. If name is "--" it will show up as a menu separator.
[in] help The help displayed on mouse hover over this FieldLayers icon.
[in] pickInstruction The pick instruction.
[in] info The FieldLayer plugin info flags: FIELDLAYER PLUGINFLAG
[in] g The allocator for the FieldLayer plugin. This is a pointer to a function that creates a new instance of FieldLayerData with NewObj() .
[in] description The name of the description resource file to use for the FieldLayer plugin without .res extension, for example "FLlayername" .
The name has to be unique, i.e. "Tdisplay" cannot be used for 2 different descriptions. See 描述 Resource for more information.
[in] icon The icon for the FieldLayer . The bitmap is copied.
The icon should be of size 32x 32 , but will be scaled if needed.
It must also be 24 bits and should if possible include an alpha to support pattern backgrounds.
[in] disklevel The plugin level is similar to a version number. The default level is 0 .
Increase this for new revisions of a plugin to allow for forward and backward compatibility.

As an example you may have updated a plugin. If you now need to write additional information for new settings or changed types for old settings increase the level.
During loading either a 0 is passed (if the file was written by the old plugin) or 1 (if the file was written by the new plugin). This allows to easily write/read new values.
For forward and backward compatibility to work any existing read order from a given level must not be changed. Cinema 4D skips any new settings automatically if they have not been read.

disklevel is only useful if variables are written/read in NodeData::Write / NodeData::Read .
[in] dragFunc (Optional) If non-null, the drag function, this is used to determine whether this layer can accept an object type (which will be passed via the SetLinkedObject function) within the FieldList .
返回
true if the object plugin was registered, otherwise false .