#include <lib_description.h>
The description class contains information for all description ID of an object.
For example it stores a BaseContainer for ID_BASEOBJECT_REL_POSITION that describes that this value is a Vector, has minimum and maximum values XYZ etc.
To access the actual values of these description parameters you will have to ask the object itself, for example with C4DAtom::GetParameter().
Example to get the name of a description, for example "Landscape Object":
{
{
if (bc)
}
}
Definition: ge_autoptr.h:37
Definition: c4d_basecontainer.h:48
String GetString(Int32 id, const maxon::String &preset=maxon::String()) const
Definition: c4d_basecontainer.h:432
Definition: c4d_baselist.h:1521
Definition: c4d_string.h:41
@ DESC_NAME
String Name for standalone use.
Definition: lib_description.h:91
#define ConstDescID(...)
Definition: lib_description.h:594
#define DESCID_ROOT
Root description ID.
Definition: lib_description.h:22
MAXON_ATTRIBUTE_FORCE_INLINE Id GetTypeName()
Definition: typename.h:32
PyObject * op
Definition: object.h:520
Represents a level within a DescID.
Definition: lib_description.h:298
PyStructSequence_Desc * desc
Definition: structseq.h:26
|
Bool | LoadDescription (const BCResourceObj *bc, Bool copy) |
|
Bool | LoadDescription (Int32 id) |
|
Bool | LoadDescription (const String &id) |
|
Bool | SortGroups () |
|
const BCResourceObj * | GetDescription () |
|
const BaseContainer * | GetParameter (const DescID &id, BaseContainer &temp, AtomArray *ar) const |
|
BaseContainer * | GetParameterI (const DescID &id, AtomArray *ar) |
|
Bool | SetParameter (const DescID &id, const BaseContainer ¶m, const DescID &groupid) |
|
void * | BrowseInit () const |
|
Bool | GetNext (void *handle, const BaseContainer **bc, DescID &id, DescID &groupid) const |
|
void | BrowseFree (void *&handle) const |
|
DescEntry * | GetFirst (const AtomArray &op) |
|
DescEntry * | GetNext (DescEntry *de) |
|
DescEntry * | GetDown (DescEntry *de) |
|
void | GetDescEntry (DescEntry *de, const BaseContainer **bc, DescID &descid) |
|
SubDialog * | CreateDialogI () |
|
void | FreeDialog (SubDialog *dlg) |
|
Bool | CreatePopupMenu (BaseContainer &menu) |
|
Bool | GetPopupId (Int32 id, const DescID &descid) |
|
Bool | CheckDescID (const DescID &searchid, const AtomArray &ops, DescID *completeid) |
|
Bool | GetSubDescriptionWithData (const DescID &did, const AtomArray &op, RESOURCEDATATYPEPLUGIN *resdatatypeplugin, const BaseContainer &bc, DescID *singledescid) |
|
const DescID * | GetSingleDescID () |
|
void | SetSingleDescriptionMode (const DescID &descid) |
|
◆ Description()
◆ ~Description()
◆ Alloc()
Allocates a description. Destroy the allocated description with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Returns
- The allocated description, or nullptr if the allocation failed.
◆ Free()
Destructs descriptions allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Parameters
-
[in,out] | description | The description to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards. |
◆ LoadDescription() [1/3]
Bool LoadDescription |
( |
const BCResourceObj * |
bc, |
|
|
Bool |
copy |
|
) |
| |
Loads a description from a BCResourceObj
, such as the one returned from GetDescription().
- Warning
- Existing entries are lost.
- Parameters
-
[in] | bc | The BCResourceObj to load the description from. |
[in] | copy | true if the description should be copied, otherwise the objects will share the same internal data so that changes to one affects the other. |
- Returns
- true if the description was loaded, otherwise false.
◆ LoadDescription() [2/3]
Loads a description by ID. The ID must have been registered with RegisterDescription().
- Warning
- Existing entries are lost.
- Parameters
-
[in] | id | The description ID, for example Obase . |
- Returns
- true if the description was loaded, otherwise false.
◆ LoadDescription() [3/3]
Loads a description by name. The description name must have been registered with RegisterDescription().
- Warning
- Existing entries are lost.
- Parameters
-
[in] | id | The description name, for example "Obase". |
- Returns
- true if the description was loaded, otherwise false.
◆ SortGroups()
◆ GetDescription()
const BCResourceObj* GetDescription |
( |
| ) |
|
Retrieves the internal pointer of the description.
- Returns
- The internal description pointer.
◆ GetParameter()
Retrieves the information container for a description parameter.
- Parameters
-
[in] | id | The description ID. |
[out] | temp | When the parameter is of a dynamic type that does not already exist as predefined container, i.e. not returnable as pointer, the result is the address of temp, where temp allows to store the data.
In this case nullptr is returned. |
[out] | ar | Most of the time this can be just AtomArray(). However dynamic descriptions (like sub-descriptions of a gradient or dynamic XPresso node) need an array of elements the parameter is assigned to. |
- Returns
- The information container, or nullptr if temp was used. The description owns the pointed container.
◆ GetParameterI()
Retrieves a pointer to the information container for a description parameter.
- Parameters
-
[in] | id | The description ID. |
[out] | ar | Most of the time this can be just AtomArray(). However dynamic descriptions (like sub-descriptions of a gradient or dynamic XPresso node) need an array of elements the parameter is assigned to. |
- Returns
- The information container. The description owns the pointed container.
◆ SetParameter()
Inserts a description parameter into the collection.
- Parameters
-
[in] | id | The description ID. |
[in] | param | The settings for the new parameter. |
[in] | groupid | The ID of the parameter's group, or DESCID_ROOT. |
- Returns
- true if the parameter was inserted, otherwise false.
◆ BrowseInit()
void* BrowseInit |
( |
| ) |
const |
Starts browsing the parameters linearly.
- Warning
- After browsing is done done BrowseFree() must be called.
- Returns
- The browse handle.
◆ GetNext() [1/2]
Retrieves the next parameter in a browse sequence initialized with BrowseInit().
- Parameters
-
[in] | handle | The browse handle returned by BrowseInit(). |
[out] | bc | Assigned the settings for the retrieved parameter. The caller owns the pointed base container. |
[out] | id | Assigned the ID of the retrieved parameter. |
[out] | groupid | Assigned the group ID of the retrieved parameter. |
- Returns
- true if a new parameter was retrieved, otherwise the sequence is finished.
◆ BrowseFree()
void BrowseFree |
( |
void *& |
handle | ) |
const |
Frees browse handles from BrowseInit().
- Parameters
-
[in,out] | handle | The handle to free. Assigned nullptr. |
◆ GetFirst()
Gets a handle to the first description entry. Use GetDescEntry() to access the information and GetNext() or GetDown() to browse the hierarchy.
- Parameters
-
[in] | op | Most of the time this can be just AtomArray(). However dynamic descriptions (like sub-descriptions of a gradient or dynamic XPresso node) need an array of elements the parameter is assigned to. |
- Returns
- The description entry handle.
◆ GetNext() [2/2]
DescEntry* GetNext |
( |
DescEntry * |
de | ) |
|
Gets the next description entry handle.
- Parameters
-
[in] | de | The current description entry handle. |
- Returns
- The next description entry handle.
◆ GetDown()
DescEntry* GetDown |
( |
DescEntry * |
de | ) |
|
Gets the child description entry handle.
- Parameters
-
[in] | de | The current description entry handle. |
- Returns
- The child description entry handle.
◆ GetDescEntry()
Retrieves the data for a description entry handle.
- Parameters
-
[in] | de | The current description entry handle. |
[out] | bc | Assigned the settings for the retrieved parameter. The caller owns the pointed base container. |
[out] | descid | Assigned the ID of the retrieved parameter. |
◆ CreateDialogI()
◆ FreeDialog()
◆ CreatePopupMenu()
Builds a popup menu for choosing a parameter in the description.
- Parameters
-
[out] | menu | Assigned the menu container. |
- Returns
- true if the menu was built, otherwise false.
◆ GetPopupId()
◆ CheckDescID()
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).
If completeid != nullptr and the return value is true the complete ID will be assigned to completeid.
- Note
- Complete ID means that all parts of the DescLevel are filled with appropriate data.
For example if the DescID passed is:
@ VECTOR_X
X component.
Definition: lib_description.h:279
CheckDescID() will return:
@ DTYPE_VECTOR
Vector
Definition: lib_description.h:70
@ DTYPE_REAL
Float
Definition: lib_description.h:68
@ ID_BASEOBJECT_GROUP1
Definition: obase.h:54
- Parameters
-
[in] | searchid | The partial ID. |
[in] | ops | Most of the time this can be just AtomArray(). However dynamic descriptions (like sub-descriptions of a gradient or dynamic XPresso node) need an array of elements the parameter is assigned to. |
[out] | completeid | Assigned the complete ID. |
- Returns
- true if a description ID searchid exists, otherwise false.
◆ GetSubDescriptionWithData()
Retrieves dynamic sub-description data (e.g. the gradient data type).
- Parameters
-
[in] | did | The description ID. |
[in] | op | The current objects. |
[in] | resdatatypeplugin | The resource data type plug, retrieved with FindResourceDataTypePlugin(). |
[out] | bc | The existing container for the data type. |
[in] | singledescid | Should be nullptr. |
- Returns
- true if successful, otherwise false.
◆ GetSingleDescID()
const DescID* GetSingleDescID |
( |
| ) |
|
◆ SetSingleDescriptionMode()
void SetSingleDescriptionMode |
( |
const DescID & |
descid | ) |
|