c4d.Description
¶
New in version R15.037.
The description class contains information for all description IDs of an object. For example it stores a
BaseContainer
for
ID_BASEOBJECT_POSITION
that describes that this value is a
Vector
, has minimum and maximum values XYZ etc.
The information about each description parameter is stored in a
BaseContainer
with the following values:
Container ID Type Description
DESC_NAME
strName for standalone use.
DESC_SHORT_NAME
strShort name, for attributes dialog.
DESC_VERSION
intShow in versions:
DESC_VERSION_DEMODemo versions.
DESC_VERSION_XLXL versions.
DESC_VERSION_ALLAll versions.
DESC_CHILDREN
BaseContainerInternal.
DESC_MIN
anyThe minimum value.
DESC_MAX
anyThe maximum value.
DESC_MINEX
bool
ifTrueDESC_MINis exclusive, otherwise it is inclusive.
DESC_MAXEX
bool
ifTrueDESC_MAXis exclusive, otherwise it is inclusive.
DESC_STEP
anyThe step for the edit field arrows.
DESC_ANIMATE
intAnimation mode:
DESC_ANIMATE_OFF
OFF
DESC_ANIMATE_ON
ON
DESC_ANIMATE_MIX
MIX
DESC_ASKOBJECT
bool
means ask object for this parameter,Truemeand look in container.False
DESC_UNIT
intUnit:
DESC_UNIT_FLOAT
FORMAT_FLOAT
DESC_UNIT_INT
FORMAT_INT
DESC_UNIT_PERCENT
FORMAT_PERCENT
DESC_UNIT_DEGREE
FORMAT_DEGREE
DESC_UNIT_METER
FORMAT_METER
DESC_PARENTGROUP
intParent ID (DescID).
DESC_CYCLE
BaseContainerContains the members of cycle as strings. (E.g.
GetString(10041) == "-X".)
DESC_HIDE
boolIndicates whether the property is hidden or not.
DESC_DEFAULT
anyDefault numeric value.
DESC_ACCEPT
BaseContainerContains the accepted IDs as strings. (E.g.
GetString(5155) == "Obase".)
DESC_SEPARATORLINE
bool
if separators should have a visible line.True
DESC_REFUSE
BaseContainerContains the refused IDs as strings. (E.g.
GetString(5155) == "Obase".)
DESC_PARENTID
intThe ID of the parent element used for indentation.
DESC_CUSTOMGUI
intThe ID of the GUI for this element. Either a custom ID or one of:
CUSTOMGUI_REAL
floatedit field.
CUSTOMGUI_REALSLIDER
floatedit field with slider.
CUSTOMGUI_REALSLIDERONLY
floatslider only.
CUSTOMGUI_VECTORVector.
CUSTOMGUI_STRINGstr field.
CUSTOMGUI_STRINGMULTIMultiple line string field.
CUSTOMGUI_STATICTEXTStatic text field.
CUSTOMGUI_CYCLESelection list field.
CUSTOMGUI_CYCLEBUTTONSelection field list with button functionality, e.g. the function of a button can be changed through a selection field list.
CUSTOMGUI_LONGLong edit field.
CUSTOMGUI_LONGSLIDERLong edit field with slider.
CUSTOMGUI_BOOLCheckbox.
CUSTOMGUI_TIMETime edit field.
CUSTOMGUI_COLORColor chooser.
CUSTOMGUI_MATRIXMatrix edit fields.
CUSTOMGUI_BUTTONButton.
CUSTOMGUI_POPUPPopup field.
CUSTOMGUI_SEPARATORSeparator.
CUSTOMGUI_SUBDESCRIPTIONSubdescription.
CUSTOMGUI_PROGRESSBARProgress bar.
DESC_COLUMNS
intNumber of columns for layout groups.
DESC_LAYOUTGROUP
bool
if this is aTrueLAYOUTGROUP.
DESC_REMOVEABLE
bool
if this entry is removable.True
DESC_GUIOPEN
bool
if the maximized GUI is shown by default.True
DESC_EDITABLE
bool
if this entry is editable.True
DESC_MINSLIDER
anyThe minimum value for the slider.
DESC_MAXSLIDER
anyThe maximum value for the slider.
DESC_GROUPSCALEV
boolAllow the group height to be scaled.
DESC_SCALEH
boolScale element horizontally.
DESC_LAYOUTVERSION
intLayout version.
DESC_ALIGNLEFT
boolAlign element left.
DESC_FITH
boolFit element.
DESC_NEWLINE
boolLine break.
DESC_TITLEBAR
boolMain group title bar.
DESC_CYCLEICONS
BaseContainer
inticon IDs for cycle.
DESC_CYCLESYMBOLS
BaseContainerstr identifiers for helpsymbol export.
DESC_PARENT_COLLAPSE
intParent collapse ID.
DESC_FORBID_INLINE_FOLDING
boolInstruct the AM to not to allow expanding inline objects for this property.
DESC_FORBID_SCALING
boolPrevents auto-scaling of the parameter with the scale tool (for
DESC_UNIT_METER).
DESC_ANGULAR_XYZ
bool
for XYZ as angular representation, orTruefor HPB.False
DESC_INPORT
boolGV in port.
DESC_OUTPORT
boolGV out port.
DESC_STATICPORT
boolGV static port.
DESC_NEEDCONNECTION
boolGV needs connection.
DESC_MULTIPLE
boolGV multiple ports allowed.
DESC_PORTONLY
boolGV port only.
DESC_CREATEPORT
boolGV create port.
DESC_PORTSMIN
intGV minimum number of ports.
DESC_PORTSMAX
intGV maximum number of ports.
DESC_NOTMOVABLE
boolGV not movable.
DESC_EDITPORT
boolGV editable.
DESC_ITERATOR
boolGV iterator port.
DESC_PARENTMSG
intUsed in the Material Editor on the boolean tabs to specifiy which section to open.
DESC_MATEDNOTEXT
boolNo text in Material Editor window.
DESC_COLUMNSMATED
boolNumber of columns in left Material Editor window.
DESC_SHADERLINKFLAG
boolSpecifies that this element is a shader link. (Only if
datatype == DTYPE_LINK.)
DESC_NOGUISWITCH
boolDisables GUI switching for this description element.
DESC_TEMPDESCID
anyPrivate. Used internally to store the prefered description ID.
DESC_IDENT
strResource identifier, e.g.
ID_BASEOBJECT_NAME.
Constant Description
DESCID_ROOTRoot.
ID_USERDATAPrivate.
DESCID_DYNAMICSUBPrivate.
c4d.
Description
¶
Description.LoadDescription()
Description.GetParameter()
Description.GetParameterI()
Description.SetParameter()
Description.CreatePopupMenu()
Description.CheckDescID()
Description.GetSubDescriptionWithData()
Description.GetSingleDescID()
Description.
__iter__
(
bc
,
id
,
groupid
)
¶
Iterate over the parameters of an object’s description.
| Parameters: |
|
|---|
Here is how to print the name of all the parameters of an object:
import c4d def main(): if op is None: return description = op.GetDescription(c4d.DESCFLAGS_DESC_0) # Get the description of the active object for bc, paramid, groupid in description: # Iterate over the parameters of the description print bc[c4d.DESC_NAME] # Print the current parameter name if __name__=='__main__': main()
Description.
LoadDescription
(
id
)
¶
New in version R18.011.
Loads a description by name or ID.
Warning
Existing description parameters are lost.
| Parameters: | id ( str or int ) – The description name (e.g. “Obase”) or ID (e.g. c4d.Obase ). |
|---|---|
| Return type: | bool |
| Returns: | True if the description was loaded, otherwise False . |
Description.
GetParameter
(
id
,
ar
)
¶
New in version R18.011.
Retrieves the information container for a parameter.
| Parameters: |
|
|---|---|
| Return type: | |
| Returns: |
The information container. Changed in version R18.057. Returns only one information container. |
Description.
GetParameterI
(
id
,
ar
)
¶
New in version R18.011.
Retrieves the information container instance for a parameter.
| Parameters: |
|
|---|---|
| Return type: | |
| Returns: |
The information container instance or None . |
Description.
SetParameter
(
id
,
param
,
groupid
)
¶
New in version R18.011.
Inserts a description parameter into the collection.
| Parameters: |
|
|---|---|
| Return type: |
bool |
| Returns: |
True if the parameter was inserted, otherwise False . |
Description.
CreatePopupMenu
(
)
¶
New in version R18.011.
Builds a popup menu for choosing a parameter in the description.
| Return type: | c4d.BaseContainer |
|---|---|
| Returns: | The menu container. |
Description.
CheckDescID
(
searchid
,
ops
)
¶
New in version R18.011.
Checks if a description ID searchid exists for the given objects ops (usually only one single object is passed as otherwise the smallest common nominator is returned).
| Parameters: |
|
|---|---|
| Return type: | |
| Returns: |
The complete ID. |
Description.
GetSubDescriptionWithData
(
did
,
op
,
bc
,
singledescid
)
¶
New in version R18.011.
Retrieves dynamic sub-description data (e.g. the gradient data type).
| Parameters: |
|
|---|---|
| Return type: |
bool |
| Returns: |
True if successful, otherwise False . |
Description.
GetSingleDescID
(
)
¶
New in version R18.011.
Retrieves the single description ID.
| Return type: | c4d.DescID |
|---|---|
| Returns: | The single description ID. |