About
A parameter description includes the type of a parameter and some additional information. Such a parameter description is stored in a BaseContainer. The different settings are accessed using the IDs described on this page. These settings define how the parameter behaves and how it is displayed in the Attribute Manager.
Such parameter descriptions are handled in the following situations:
Parameters Types
While certain settings apply to all parameter types, others are specific to certain parameter types. With this utility function one can create a BaseContainer with the correct default settings:
These are the default Cinema 4D parameter and data types. For plugin data types the plugin ID must be used.
- Note
- Do not confuse these types with DA_TYPES (see GeData Manual).
if (singleid ==
nullptr || cid.
IsPartOf(*singleid,
nullptr))
{
return;
}
Other parameter types are
Other data types are defined as custom data types like CUSTOMDATATYPE_BITMAPBUTTON etc.
Groups
Parameters are organized in parameter groups. These groups are used to define the structure and the layout of the parameters.
A parameter is typically part of a group:
The group IDs of specific elements are defined in the corresponding header files like ID_OBJECTPROPERTIES in Obase.h
.
{
const DescID*
const descID =
static_cast<const DescID*
>(customData);
if (descID == nullptr)
const Int32 id = descID->operator[](-1).
id;
}
A row of a group can be filled with dummy elements so that the next elements start in a new row:
- DESC_NEWLINE: The element in question is used as a "line break". Typically used with a static text element.
Parent Parameters
A parameter can be a parent parameter of another parameter. The child parameter is hidden until the user clicks on a little arrow.
Layout
The parameter description includes settings that define how a group or parameter should be scaled in the Attribute Manager.
Visibility
The parameter description also includes information on how the parameter is displayed:
- Note
- To enable or disable a parameter in the Attribute Manager one must implement NodeData::GetDEnabling(), see NodeData::GetDEnabling() Manual.
The settings of a custom GUI also have to be stored in the BaseContainer.
Name
The name of a parameter is displayed in the Attribute Manager or other contexts:
- DESC_NAME: The parameter name for standalone use.
- DESC_SHORT_NAME: The short name, displayed in the Attribute Manager.
- DESC_IDENT: The resource identifier, e.g. "ID_BASEOBJECT_REL_POSITION". This value is typically read-only.
- DESC_IDENT_ORIGIN: The resource identifier, e.g. "ID_BASEOBJECT_REL_POSITION". This value is typically read-only.
Animation
One can enable or disable if a parameter should be animateable:
Values
For specific parameter types certain values can be set:
For DTYPE_REAL, DTYPE_LONG and DTYPE_VECTOR parameters:
DTYPE_REAL and DTYPE_VECTOR can display values with a given unit:
- Note
- These are the same formats as used with GeDialog::SetFloat().
The values selectable in a drop down parameter (based on DTYPE_LONG) are stored in sub-containers:
Both DTYPE_BASELISTLINK and CUSTOMDATATYPE_INEXCLUDE_LIST parameter types can reference Cinema 4D elements.
- Note
- The check is done with C4DAtom::IsInstanceOf(), so also category types like Obase etc. can be used.
A DTYPE_BASELISTLINK parameter can also reference and manage a shader:
A DTYPE_SEPARATOR can be displayed with or without a line:
If a DTYPE_VECTOR is used to display a rotation (DESC_UNIT_DEGREE) it can display this as XYZ or HPB:
- DESC_ANGULAR_XYZ: Set to true for XYZ as angular representation, or false for HPB.
Material Editor
Materials can include parameter groups that are presented as "channels" in the Material Editor window. The left column of the Material Editor can include references to these channels or simple parameters:
A DTYPE_BOOL can be used to enable or disable a channel group.
{
}
{
}
{
description->
SetParameter(cid, settings, ID_SETTINGS_GROUP);
}
Further Reading
@ DTYPE_BOOL
GV Bool. ID_GV_DATA_TYPE_BOOL.
Definition: lib_description.h:75
const GeData & GetData(Int32 id) const
Definition: c4d_basecontainer.h:262
@ DESC_ANGULAR_XYZ
Bool true for XYZ as angular representation, or false for HPB.
Definition: lib_description.h:146
BaseContainer GetCustomDataTypeDefault(Int32 type)
@ DESC_ALIGNLEFT
Bool Align element left.
Definition: lib_description.h:137
@ DESC_SEPARATORLINE
Bool true if separators should have a visible line.
Definition: lib_description.h:122
GeData * SetData(Int32 id, const GeData &n)
Definition: c4d_basecontainer.h:255
@ DTYPE_SEPARATOR
Separator.
Definition: lib_description.h:63
@ DESC_ANIMATE
Int32 Animation mode:
Definition: lib_description.h:104
void SetCustomDataType(Int32 datatype, const CustomDataType &v)
Definition: c4d_gedata.h:664
@ DESC_UNIT_METER
FORMAT_METER
Definition: lib_description.h:115
#define CUSTOMGUI_LINKBOX
Link box custom GUI ID.
Definition: customgui_linkbox.h:18
Definition: lib_description.h:328
Int32 GetType(void) const
Definition: c4d_gedata.h:407
void SetInt32(Int32 id, Int32 l)
Definition: c4d_basecontainer.h:505
@ DESC_PARENTMSG
DescID Used in the Material Editor on the boolean tabs to specify which section to open.
Definition: lib_description.h:161
@ DESC_SHADERLINKFLAG
Bool Specifies that this element is a shader link. (Only if datatype==DTYPE_BASELISTLINK....
Definition: lib_description.h:164
void SetString(Int32 id, const maxon::String &s)
Definition: c4d_basecontainer.h:569
@ DESC_MATEDNOTEXT
Bool No text in Material Editor window.
Definition: lib_description.h:162
@ DTYPE_BASELISTLINK
BaseLink.
Definition: lib_description.h:74
@ DESC_FORBID_INLINE_FOLDING
Bool Instructs the Attribute Manager to not allow expanding inline objects for entry.
Definition: lib_description.h:144
@ DESC_CYCLE
BaseContainer Contains members of cycle as string. (E.g. GetString(10041) == "-X"....
Definition: lib_description.h:118
#define CUSTOMDATATYPE_DESCID
DescID custom data type ID.
Definition: lib_description.h:261
Bool IsPartOf(const DescID &cmp, Int32 *pos) const
#define DATETIME_DATE_CONTROL
Bool true, if it is a calendar.
Definition: customgui_datetime.h:29
#define Ocube
Cube.
Definition: ge_prepass.h:1074
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
@ DESC_COLUMNS
Int32 Number of columns for layout groups (DTYPE_GROUP).
Definition: lib_description.h:127
void SetBool(Int32 id, Bool b)
Definition: c4d_basecontainer.h:498
Bool SetParameter(const DescID &id, const BaseContainer ¶m, const DescID &groupid)
@ DESC_MAXSLIDER
Int32/Float/Vector Maximum value for slider.
Definition: lib_description.h:133
@ DESC_NEWLINE
Bool Line break.
Definition: lib_description.h:139
@ DESC_MIN
Int32/Float/Vector Minimum value.
Definition: lib_description.h:99
#define CUSTOMGUI_BUTTON
Button.
Definition: lib_description.h:217
#define CUSTOMGUI_REALSLIDER
Float edit field with slider.
Definition: lib_description.h:202
#define BITMAPBUTTON_ICONID1
Int32 Registered icon bitmap ID. On state for toggle buttons.
Definition: customgui_bitmapbutton.h:47
@ DTYPE_GROUP
Group.
Definition: lib_description.h:56
#define DATETIME_GUI
DateTime custom GUI ID.
Definition: customgui_datetime.h:20
@ DESC_FORBID_SCALING
Bool Prevents auto-scaling of the parameter with the scale tool (for DESC_UNIT_METER).
Definition: lib_description.h:145
#define Osphere
Sphere.
Definition: ge_prepass.h:1075
Definition: c4d_string.h:38
@ DTYPE_BUTTON
Button.
Definition: lib_description.h:61
static String IntToString(Int32 v)
Definition: c4d_string.h:495
@ DESC_UNIT_PERCENT
FORMAT_PERCENT
Definition: lib_description.h:113
#define DATETIME_TIME_CONTROL
Bool true, if it is a clock.
Definition: customgui_datetime.h:28
@ DESC_CYCLEICONS
BaseContainer Icon IDs for cycle.
Definition: lib_description.h:141
@ DESC_ANIMATE_OFF
Parameter is not animatable.
Definition: lib_description.h:105
@ DTYPE_VECTOR
Vector
Definition: lib_description.h:70
#define IDM_CUT
Cut.
Definition: ge_prepass.h:3675
@ DESC_SHORT_NAME
String Short name, for attributes dialog.
Definition: lib_description.h:92
#define IDM_DELETE
Delete.
Definition: ge_prepass.h:3678
Represents a level within a DescID.
Definition: lib_description.h:287
@ DESC_MAX
Int32/Float/Vector Maximum value.
Definition: lib_description.h:100
@ DTYPE_LONG
Int32
Definition: lib_description.h:67
#define NOTOK
Definition: ge_sys_math.h:267
@ DTYPE_STRING
String.
Definition: lib_description.h:72
#define Tbaselist2d
2D list.
Definition: ge_prepass.h:969
@ DESC_HIDE
Bool Indicates whether the property is hidden or not.
Definition: lib_description.h:119
Definition: c4d_gedata.h:82
maxon::Int32 Int32
Definition: ge_sys_math.h:60
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:210
const DescID * GetSingleDescID()
Private.
void SetFloat(Int32 id, Float r)
Definition: c4d_basecontainer.h:533
Base class for custom data types.
Definition: c4d_customdatatype.h:50
@ DESC_NOGUISWITCH
Bool Disables GUI switching for this description element.
Definition: lib_description.h:165
@ DESC_SCALEH
Bool Scale element horizontally.
Definition: lib_description.h:135
@ DESC_CUSTOMGUI
Int32 The ID of the GUI for this element. Either a custom ID or one of: CUSTOMGUI
Definition: lib_description.h:125
@ DESC_ACCEPT
BaseContainer Contains the accepted IDs as strings. For C4DAtom::IsInstanceOf() checks....
Definition: lib_description.h:121
#define CUSTOMGUI_SEPARATOR
Separator.
Definition: lib_description.h:219
#define DATETIME_DATA
DateTime custom data ID.
Definition: customgui_datetime.h:23
CustomDataType * GetCustomDataType(Int32 datatype) const
Definition: c4d_gedata.h:507
#define DATETIME_NOW_BUTTON
Bool true, to add "Now" button.
Definition: customgui_datetime.h:30
void SetContainer(Int32 id, const BaseContainer &s)
Definition: c4d_basecontainer.h:597
@ DESC_NAME
String Name for standalone use.
Definition: lib_description.h:91
#define BITMAPBUTTON_BUTTON
Definition: customgui_bitmapbutton.h:35
@ DESC_UNIT_DEGREE
FORMAT_DEGREE
Definition: lib_description.h:114
@ DESC_PARENTGROUP
Int32/DescID Parent ID.
Definition: lib_description.h:117
@ DESC_UNIT
Int32 Unit for DTYPE_REAL/DTYPE_VECTOR:
Definition: lib_description.h:110
@ DESC_DEFAULT
Int32/Float/Vector Default numeric value.
Definition: lib_description.h:120
@ ID_OBJECTPROPERTIES
Definition: obase.h:56
#define CUSTOMGUI_CYCLE
Selection list field.
Definition: lib_description.h:209
@ DTYPE_REAL
Float
Definition: lib_description.h:68
@ DESC_STEP
Int32/Float/Vector The step for the edit field arrows.
Definition: lib_description.h:103
#define BOOL_PAGEMODE
Page mode for boolean elements. If set it means that this boolean will have no checkbox....
Definition: lib_description.h:31
@ DESC_PARENT_COLLAPSE
Int32 Parent collapse ID.
Definition: lib_description.h:143
@ DESC_MINSLIDER
Int32/Float/Vector Minimum value for slider.
Definition: lib_description.h:132
#define CUSTOMGUI_TEXBOX
Shader link custom GUI ID.
Definition: customgui_texbox.h:18
#define MAXON_SCOPE
Definition: apibase.h:2798
Definition: c4d_basecontainer.h:46
@ DTYPE_STATICTEXT
Static text.
Definition: lib_description.h:64