#include <c4d_customdatatype.h>
详细描述
A data class for creating custom data types' aliases.
These can be used in descriptions as a shortcut for a custom data type with certain options, for example like
VECTOR
and
COLOR
.
使用
RegisterResourceDataTypePlugin()
to register a resourse data type plugin.
构造函数 & 析构函数文档编制
◆
ResourceDataTypeClass()
Constructor. Pass the ID and plugin structure for the custom data type to create an alias for.
The easiest way to get the plugin structure is to call
FindCustomDataTypePlugin()
, for example:
ResourceDataTypeClass
(MY_CUSTOM_DATA_TYPE,
FindCustomDataTypePlugin
(MY_CUSTOM_DATA_TYPE));
-
参数
-
[in]
|
datatypeid
|
The custom data type ID.
|
[in]
|
datatype
|
The custom data type plugin structure.
|
成员函数文档编制
◆
GetId()
Called to get the plugin ID of the resource data type.
-
返回
-
A unique plugin ID. Must be obtained from
http://www.plugincafe.com
◆
GetCustomDataType()
virtual
Int32
GetCustomDataType
|
(
|
|
)
|
|
|
virtual
|
Called to get the plugin ID of the custom data type that this is an alias for.
-
注意
-
By default returns the value passed to the constructor.
-
返回
-
The custom data type ID for the resource type.
◆
GetCustomDataTypePlugin()
virtual CUSTOMDATATYPEPLUGIN* GetCustomDataTypePlugin
|
(
|
|
)
|
|
|
virtual
|
Called to get the internal plugin structure of the custom data type that this is an alias for.
-
注意
-
By default returns the value passed to the constructor.
-
返回
-
The plugin structure of the custom data of the resource type.
Cinema 4D
owns the pointed plugin structure.
◆
GetDefaultProperties()
Called to provide default properties for the data type.
These properties will be used if the user does not specify anything else.
It is common to add
DESC_ANIMATE
and
DESC_CUSTOMGUI
to the default properties:
virtual
void
GetDefaultProperties
(
BaseContainer
&data)
{
data.
SetInt32
(
GRADIENTPROPERTY_ALPHA_WITH_COLOR
,
false
);
data.
SetInt32
(
GRADIENTPROPERTY_ALPHA
,
false
);
data.
SetInt32
(
DESC_ANIMATE
,
DESC_ANIMATE_ON
);
data.
SetInt32
(
DESC_CUSTOMGUI
,
CUSTOMGUI_GRADIENT
);
}
-
注意
-
This is normally the very reason for using
ResourceDataTypeClass
.
-
参数
-
[in]
|
data
|
Filled with the default properties for the data type in the resource.
|
◆
GetResourceSym()
virtual const
Char
* GetResourceSym
|
(
|
|
)
|
|
|
virtual
|
Called to get the symbol to use in resource files, for example
"GRADIENT"
.
-
注意
-
Only 7-bit ASCII characters are allowed, hence the
Char
type.
-
返回
-
A pointer to a global
const Char*
string with the resource symbol.
◆
GetProperties()
Called to get the properties that the data type accepts in resource files.
-
另请参阅
-
CustomProperty
.
-
返回
-
A pointer to a global array of
CustomProperty
elements, ended with a
CUSTOMTYPE::END
property:
CustomProperty
bitmapbuttonprops[] =
{
{
CUSTOMTYPE::FLAG
,
BITMAPBUTTON_BORDER
,
"BORDER"
},
{
CUSTOMTYPE::FLAG
,
BITMAPBUTTON_BUTTON
,
"BUTTON"
},
{
CUSTOMTYPE::END
, 0,
nullptr
}
};
◆
GetDescription()
Called to add sub-parameters to the description for the data.
Modify the passed description
res
object as needed, set the appropriate
flags
and then make sure to include a call to the parent at the end:
return
SUPER::GetDescription(data, description, flags, parentdescription);
-
参数
-
[in]
|
data
|
The custom data type to get the description for. Points to an instance of the internal data type.
Cinema 4D
owns the pointed data.
|
[out]
|
res
|
The description to add the parameters to.
|
[in,out]
|
flags
|
The flags for the description operation:
DESCFLAGS_DESC
|
[in]
|
parentdescription
|
The description container for the parent's description, encoded as described in
描述
.
|
[out]
|
singledescid
|
Private
.
|
-
返回
-
true
if successful, otherwise
false
. It is recommended to include a call to the parent function as last return.
◆
CheckData()
Called to let validate the values of data with the settings in bc.
Modify data accordingly so that it is valid.
-
参数
-
[in]
|
bc
|
The settings container.
|
[in,out]
|
data
|
The data value to check.
|
Member Data Documentation
◆
datatypeid
◆
datatype
CUSTOMDATATYPEPLUGIN* datatype
|
private
|
@ DESC_ANIMATE
Int32 Animation mode:
定义:
lib_description.h:104
CUSTOMDATATYPEPLUGIN * FindCustomDataTypePlugin(Int32 type)
virtual void GetDefaultProperties(BaseContainer &data)
void SetInt32(Int32 id, Int32 l)
定义:
c4d_basecontainer.h:505
#define GRADIENTPROPERTY_ALPHA
定义:
customgui_gradient.h:49
#define BITMAPBUTTON_BORDER
定义:
customgui_bitmapbutton.h:33
定义:
c4d_customguidata.h:113
#define CUSTOMGUI_GRADIENT
Gradient custom GUI ID.
定义:
customgui_gradient.h:26
@ DESC_CUSTOMGUI
Int32 The ID of the GUI for this element. Either a custom ID or one of: CUSTOMGUI
定义:
lib_description.h:125
#define GRADIENTPROPERTY_ALPHA_WITH_COLOR
定义:
customgui_gradient.h:44
@ DESC_ANIMATE_ON
Parameter is animatable.
定义:
lib_description.h:106
ResourceDataTypeClass(Int32 datatypeid, CUSTOMDATATYPEPLUGIN *datatype)
#define BITMAPBUTTON_BUTTON
定义:
customgui_bitmapbutton.h:35
@ FLAG
Bool data. (Either the property is there or not.)
定义:
c4d_basecontainer.h:46