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.
- ::DTYPE_LONG: A Int32 parameter.
- ::DTYPE_REAL: A Float parameter.
- ::DTYPE_COLOR: A Color parameter.
- ::DTYPE_COLORA: A RGBA Color value.
- ::DTYPE_BOOL: A Bool parameter.
- ::DTYPE_TIME: A BaseTime parameter.
- ::DTYPE_VECTOR: A Vector parameter.
- ::DTYPE_VECTOR4D: A 4D vector.
- ::DTYPE_MATRIX: A Matrix parameter.
- ::DTYPE_STRING: A String parameter.
- ::DTYPE_FILENAME: A Filename parameter.
- ::DTYPE_TEXTURE: A texture name (Filename). Do not confuse this with a shader link which is a ::DTYPE_BASELISTLINK with a custom GUI.
- ::DTYPE_BASELISTLINK: A BaseLink parameter. May also be a shader link displaying and managing a shader.
- Note
- Do not confuse these types with DA_TYPES (see GeData Manual).
const DescID* const singleid = description->GetSingleDescID();
if (singleid == nullptr || cid.IsPartOf(*singleid, nullptr))
{
settings.SetString(
DESC_NAME,
"Boolean Parameter"_s);
return;
}
@ DESC_NAME
String Name for standalone use.
Definition: lib_description.h:90
@ DTYPE_BOOL
GV Bool. ID_GV_DATA_TYPE_BOOL.
Definition: lib_description.h:74
#define ConstDescID(...)
Definition: lib_description.h:592
BaseContainer GetCustomDataTypeDefault(Int32 type)
@ ID_OBJECTPROPERTIES
Definition: obase.h:56
Other parameter types are
- ::DTYPE_BUTTON: A button parameter.
- ::DTYPE_SEPARATOR: A separator parameter.
- ::DTYPE_STATICTEXT: A static text parameter.
- ::DTYPE_POPUP: A popup parameter.
- ::DTYPE_SUBCONTAINER: A sub-container. Typically for user data.
- ::DTYPE_GROUP: A parameter group. See Groups
Other data types are defined as custom data types like CUSTOMDATATYPE_BITMAPBUTTON etc.
{
}
{
settings.SetString(
DESC_NAME,
"Bitmap Button"_s);
}
#define BITMAPBUTTON_BUTTON
Definition: customgui_bitmapbutton.h:34
#define BITMAPBUTTON_ICONID1
::Int32 Registered icon bitmap ID. On state for toggle buttons.
Definition: customgui_bitmapbutton.h:46
#define CUSTOMGUI_BUTTON
Button.
Definition: lib_description.h:224
#define MAXON_SCOPE
Definition: apibase.h:2891
@ DESC_ALIGNLEFT
Bool Align element left.
Definition: lib_description.h:136
@ DESC_CUSTOMGUI
Int32 The ID of the GUI for this element. Either a custom ID or one of: CUSTOMGUI
Definition: lib_description.h:124
@ DTYPE_BUTTON
Button.
Definition: lib_description.h:60
#define IDM_DELETE
Delete.
Definition: ge_prepass.h:3894
Groups
Parameters are organized in parameter groups. These groups are used to define the structure and the layout of the parameters.
- ::DTYPE_GROUP: The type of a parameter group.
- ::DESC_COLUMNS: Number of columns for layout groups.
- ::DESC_LAYOUTGROUP: Set to true for layout groups. The content of such layout groups must be organized in sub-groups, see Layout Groups.
- ::DESC_GROUPSCALEV: Allow the group height to be scaled.
- ::DESC_TITLEBAR: Main group title bar option. If the title bar should be hidden ::DESC_NAME must not be set, only ::DESC_SHORT_NAME.
- ::DESC_DEFAULT: If set to 1 the group is unfolded by default. If set to -1 it will always be unfolded when re-created.
{
settings.SetString(
DESC_NAME,
"New Group"_s);
description->SetParameter(groupID, settings,
ConstDescID(DescLevel(0)));
}
{
settings.SetString(
DESC_NAME,
"Parameter A"_s);
description->SetParameter(cid, settings,
ConstDescID(DescLevel(ID_GROUP)));
}
{
settings.SetString(
DESC_NAME,
"Parameter B"_s);
description->SetParameter(cid, settings,
ConstDescID(DescLevel(ID_GROUP)));
}
}
@ DESC_DEFAULT
Int32/Float/Vector Default numeric value.
Definition: lib_description.h:119
@ DESC_SCALEH
Bool Scale element horizontally.
Definition: lib_description.h:134
@ DESC_COLUMNS
Int32 Number of columns for layout groups (DTYPE_GROUP).
Definition: lib_description.h:126
@ DTYPE_STRING
String.
Definition: lib_description.h:71
@ DTYPE_GROUP
Group.
Definition: lib_description.h:55
A parameter is typically part of a group:
- ::DESC_PARENTGROUP: The ID of the parent group.
The group IDs of specific elements are defined in the corresponding header files like ID_OBJECTPROPERTIES in Obase.h
.
{
const DescID* const descID = parentid.GetCustomDataType<DescID>();
if (descID == nullptr)
const Int32 id = descID->operator[](-1).
id;
}
@ DESC_PARENTGROUP
Int32/Parent ID.
Definition: lib_description.h:116
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:204
#define CUSTOMDATATYPE_DESCID
DescID custom data type ID.
Definition: lib_description.h:270
maxon::Int32 Int32
Definition: ge_sys_math.h:51
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.
description->SetParameter(cid, settings,
ConstDescID(DescLevel(ID_GROUP)));
@ DESC_NEWLINE
Bool Line break.
Definition: lib_description.h:138
@ DTYPE_STATICTEXT
Static text.
Definition: lib_description.h:63
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.
- ::DESC_PARENT_COLLAPSE: The ID of the parent parameter.
{
}
{
GeData parentIdData;
parentIdData.SetCustomDataType<DescID>(parentID);
}
#define NOTOK
Definition: ge_sys_math.h:258
@ DESC_PARENT_COLLAPSE
Int32 Parent collapse ID.
Definition: lib_description.h:142
Layout
The parameter description includes settings that define how a group or parameter should be scaled in the Attribute Manager.
- ::DESC_SCALEH: The element is scaled horizontally.
- ::DESC_FITH: The element fits horizontally.
- ::DESC_ALIGNLEFT: The element is aligned left.
Visibility
The parameter description also includes information on how the parameter is displayed:
- ::DESC_HIDE: Indicates whether the element is hidden or not. Especially used to hide a parameter from a loaded parameter description.
- ::DESC_CUSTOMGUI: The ID of the custom GUI element.
- ::DESC_GUIOPEN: Set to true if the maximized GUI is shown by default.
- ::DESC_FORBID_INLINE_FOLDING: Instructs the Attribute Manager to not allow expanding inline objects.
- ::DESC_NOGUISWITCH: Disables GUI switching for this element.
- ::DESC_DISABLELAYOUTSWITCH: Hides the Layout Switch arrow.
- ::DESC_HIDE_WHEN_INLINE: Hide this attribute in inline descriptions.
- ::DESC_REPLACE_HIDE: Element replaced by a complex UI.
- ::DESC_REPLACECOMPLEXUI: BaseContainer filled with descids of props to replace.
- Note
- To enable or disable a parameter in the Attribute Manager one must implement NodeData::GetDEnabling(), see NodeData::GetDEnabling() Manual.
settings.SetString(
DESC_NAME,
"Float Value"_s);
#define CUSTOMGUI_REALSLIDER
::Float edit field with slider.
Definition: lib_description.h:209
@ DESC_NOGUISWITCH
Bool Disables GUI switching for this description element.
Definition: lib_description.h:165
@ DTYPE_REAL
Float
Definition: lib_description.h:67
#define CUSTOMGUI_TEXBOX
Shader link custom GUI ID.
Definition: customgui_texbox.h:17
@ DESC_FORBID_INLINE_FOLDING
Bool Instructs the Attribute Manager to not allow expanding inline objects for entry.
Definition: lib_description.h:143
@ DESC_SHADERLINKFLAG
Bool Specifies that this element is a shader link. (Only if datatype==DTYPE_BASELISTLINK....
Definition: lib_description.h:164
@ DTYPE_BASELISTLINK
BaseLink.
Definition: lib_description.h:73
The settings of a custom GUI also have to be stored in the BaseContainer.
#define DATETIME_DATA
DateTime custom data ID.
Definition: customgui_datetime.h:22
#define DATETIME_GUI
DateTime custom GUI ID.
Definition: customgui_datetime.h:19
#define DATETIME_DATE_CONTROL
::Bool true, if it is a calendar.
Definition: customgui_datetime.h:28
#define DATETIME_TIME_CONTROL
::Bool true, if it is a clock.
Definition: customgui_datetime.h:27
#define DATETIME_NOW_BUTTON
::Bool true, to add "Now" button.
Definition: customgui_datetime.h:29
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.
settings.SetString(
DESC_NAME,
"Parameter Name"_s);
@ DESC_SHORT_NAME
String Short name, for attributes dialog.
Definition: lib_description.h:91
Animation
One can enable or disable if a parameter should be animateable:
- ::DESC_ANIMATE: The animation mode:
- ::DESC_ANIMATE_OFF: Parameter is not animatable.
- ::DESC_ANIMATE_ON: Parameter is animatable.
- ::DESC_ANIMATE_MIX: Parameter is animatable, but needs to know the left and right data element. An example is the Target expression that interpolates the Name parameter. If MIX is specified, the expression can at any time call BaseList2D::GetAnimatedParameter() to get the left, right and mix values.
settings.SetString(
DESC_NAME,
"Non Animate"_s);
@ DESC_ANIMATE
Int32 Animation mode:
Definition: lib_description.h:103
@ DESC_ANIMATE_OFF
Parameter is not animatable.
Definition: lib_description.h:104
Values
For specific parameter types certain values can be set:
For ::DTYPE_REAL, ::DTYPE_LONG and ::DTYPE_VECTOR parameters:
- ::DESC_MIN: Minimum value.
- ::DESC_MAX: Maximum value.
- ::DESC_MINEX: Defines if ::DESC_MIN is exclusive, otherwise it is inclusive.
- ::DESC_MAXEX: Defines if ::DESC_MAX is exclusive, otherwise it is inclusive.
- ::DESC_STEP: The step for the edit field arrows.
- ::DESC_DEFAULT: Default numeric value.
- ::DESC_MINSLIDER: Minimum value for slider.
- ::DESC_MAXSLIDER: Maximum value for slider.
@ DESC_MAXSLIDER
Int32/Float/Vector Maximum value for slider.
Definition: lib_description.h:132
@ DESC_MINSLIDER
Int32/Float/Vector Minimum value for slider.
Definition: lib_description.h:131
@ DESC_STEP
Int32/Float/Vector The step for the edit field arrows.
Definition: lib_description.h:102
@ DESC_MIN
Int32/Float/Vector Minimum value.
Definition: lib_description.h:98
@ DESC_UNIT
Int32 Unit for DTYPE_VECTOR:
Definition: lib_description.h:109
@ DESC_UNIT_PERCENT
FORMAT_PERCENT
Definition: lib_description.h:112
@ DESC_MAX
Int32/Float/Vector Maximum value.
Definition: lib_description.h:99
::DTYPE_REAL and ::DTYPE_VECTOR can display values with a given unit:
- ::DESC_UNIT: Unit type.
- ::DESC_UNIT_FLOAT: Float.
- ::DESC_UNIT_INT: Integer.
- ::DESC_UNIT_PERCENT: Percentage.
- ::DESC_UNIT_DEGREE: Degree.
- ::DESC_UNIT_METER: Meters. The "Scale" tool will auto-scale these parameters when the host BaseObject is scaled.
- ::DESC_UNIT_TIME: Time.
- ::DESC_FORBID_SCALING: Prevents auto-scaling "meter" parameters.
- Note
- These are the same formats as used with GeDialog::SetFloat().
@ DESC_UNIT_METER
FORMAT_METER
Definition: lib_description.h:114
@ DESC_FORBID_SCALING
Bool Prevents auto-scaling of the parameter with the scale tool (for DESC_UNIT_METER).
Definition: lib_description.h:144
The values selectable in a drop down parameter (based on ::DTYPE_LONG) are stored in sub-containers:
- ::DESC_CYCLE: Setting for a BaseContainer with the members of the cycle as string.
- ::DESC_CYCLEICONS: Setting for a BaseContainer with the icon IDs for cycle.
settings.SetString(
DESC_NAME,
"Drop Down"_s);
items.SetString(0,
"Item 1"_s);
items.SetString(1,
"Item 2"_s);
items.SetString(2,
"Item 3"_s);
BaseContainer icons;
icons.SetInt32(0, 5159);
#define CUSTOMGUI_CYCLE
Selection list field.
Definition: lib_description.h:216
@ DESC_CYCLEICONS
BaseContainer Icon IDs for cycle.
Definition: lib_description.h:140
@ DESC_CYCLE
BaseContainer Contains members of cycle as string. (E.g. GetString(10041) == "-X"....
Definition: lib_description.h:117
@ DTYPE_LONG
Int32
Definition: lib_description.h:66
#define IDM_CUT
Cut.
Definition: ge_prepass.h:3891
PyWideStringList Py_ssize_t wchar_t ** items
Definition: initconfig.h:448
Both ::DTYPE_BASELISTLINK and CUSTOMDATATYPE_INEXCLUDE_LIST parameter types can reference Cinema 4D elements.
- ::DESC_ACCEPT: Setting for a BaseContainer with accepted element IDs.
- ::DESC_REFUSE: Setting for a BaseContainer with refused element IDs.
- Note
- The check is done with C4DAtom::IsInstanceOf(), so also category types like Obase etc. can be used.
BaseContainer ac;
#define CUSTOMGUI_LINKBOX
Link box custom GUI ID.
Definition: customgui_linkbox.h:17
@ DESC_ACCEPT
BaseContainer Contains the accepted IDs as strings. For C4DAtom::IsInstanceOf() checks....
Definition: lib_description.h:120
#define Ocube
Cube.
Definition: ge_prepass.h:1118
#define Osphere
Sphere.
Definition: ge_prepass.h:1119
A ::DTYPE_BASELISTLINK parameter can also reference and manage a shader:
- ::DESC_SHADERLINKFLAG: Specifies that this element is a shader link.
A ::DTYPE_SEPARATOR can be displayed with or without a line:
- ::DESC_SEPARATORLINE: Set to true if the separator should have a visible line.
#define CUSTOMGUI_SEPARATOR
Separator.
Definition: lib_description.h:226
@ DESC_SEPARATORLINE
Bool true if separators should have a visible line.
Definition: lib_description.h:121
@ DTYPE_SEPARATOR
Separator.
Definition: lib_description.h:62
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.
@ DESC_UNIT_DEGREE
FORMAT_DEGREE
Definition: lib_description.h:113
@ DESC_ANGULAR_XYZ
Bool true for XYZ as angular representation, or false for HPB.
Definition: lib_description.h:145
@ DTYPE_VECTOR
Vector
Definition: lib_description.h:69
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:
- ::DESC_MATEDNOTEXT: Defines if the parameter name is displayed in the Material Editor window.
- ::DESC_COLUMNSMATED: Number of columns in left Material Editor window.
- ::DESC_MATERIALEDITOR_LEFTSIDE: True if the property should appear on the left side of the material editor.
settings.SetString(
DESC_NAME,
"Float Value"_s);
@ DESC_MATEDNOTEXT
Bool No text in Material Editor window.
Definition: lib_description.h:162
#define Tbaselist2d
2D list.
Definition: ge_prepass.h:995
A ::DTYPE_BOOL can be used to enable or disable a channel group.
- ::DESC_PARENTMSG: ID of the associated group.
- BOOL_PAGEMODE: Defines if a checkbox is displayed or not.
{
}
{
settings.SetString(
DESC_NAME,
"Material Properties"_s);
description->SetParameter(cid, settings,
ConstDescID(DescLevel(0)));
}
{
settings.SetString(
DESC_NAME,
"Some Parameter"_s);
description->SetParameter(cid, settings,
ConstDescID(DescLevel(ID_SETTINGS_GROUP)));
}
@ DESC_HIDE
Bool Indicates whether the property is hidden or not.
Definition: lib_description.h:118
@ DESC_PARENTMSG
::DescID Used in the Material Editor on the boolean tabs to specify which section to open.
Definition: lib_description.h:161
#define BOOL_PAGEMODE
Page mode for boolean elements. If set it means that this boolean will have no checkbox....
Definition: lib_description.h:30
Further Reading