c4d_customdatatype.h File Reference

Classes

struct   CustomDataType
struct   GvHelper
struct   iCustomDataType< X >
class   CustomDataTypeClass
class   ResourceDataTypeClass

Macros

#define  CUSTOMDATATYPE_INFO_HASSUBDESCRIPTION
#define  CUSTOMDATATYPE_INFO_NEEDDATAFORSUBDESC
#define  CUSTOMDATATYPE_INFO_TOGGLEDISPLAY
#define  CUSTOMDATATYPE_INFO_DONTREGISTERGVTYPE
#define  CUSTOMDATATYPE_INFO_SUBDESCRIPTIONDISABLEGUI
#define  CUSTOMDATATYPE_INFO_UNDOSAMECUSTOMGUI
#define  CUSTOMDATATYPE_INFO_HASSUBDESCRIPTION_NOANIM
#define  CUSTOMDATATYPE_INFO_LOADSAVE
#define  CUSTOMDATATYPE_INFO_NO_GUI_COPY

函数

Bool   RegisterCustomDataTypePlugin (const maxon::String &str, Int32 info, CustomDataTypeClass *dat, Int32 disclevel)
Bool   RegisterResourceDataTypePlugin (const maxon::String &str, Int32 info, ResourceDataTypeClass *dat, Int32 disclevel)

Function Documentation

◆  RegisterCustomDataTypePlugin()

Bool RegisterCustomDataTypePlugin ( const maxon::String str ,
Int32   info ,
CustomDataTypeClass dat ,
Int32   disclevel  
)

Registers a custom data type plugin.

参数
[in] str The name of the plugin.
[in] info The custom data type plugin info flags: CUSTOMDATATYPE_INFO PLUGINFLAG
[in] dat An instance for the custom data type plugin. Cinema 4D takes over the ownership of the pointed data instance.
[in] disclevel 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 CustomDataTypeClass::WriteData / CustomDataTypeClass::ReadData .
返回
true if the custom data type plugin was registered, otherwise false .

◆  RegisterResourceDataTypePlugin()

Bool RegisterResourceDataTypePlugin ( const maxon::String str ,
Int32   info ,
ResourceDataTypeClass dat ,
Int32   disclevel  
)

Registers a resource data type plugin.

参数
[in] str The name of the plugin.
[in] info The resource data type plugin info flags: PLUGINFLAG
[in] dat An instance for the resource data type plugin. Cinema 4D takes over the ownership of the pointed data instance.
[in] disclevel 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 CustomDataTypeClass::WriteData / CustomDataTypeClass::ReadData .
返回
true if the resource data type plugin was registered, otherwise false .