BaseList2D Class Reference

#include <c4d_baselist.h>

Inheritance diagram for BaseList2D:

Detailed Description

Represents a C4DAtom that resides in a 2D list.

Note
Has to be created with Alloc() and destroyed with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

Private Member Functions

 BaseList2D ()
 
 ~BaseList2D ()
 

Alloc/Free

static BaseList2DAlloc (Int32 type)
 
static void Free (BaseList2D *&bl)
 

Navigation

BaseList2DGetNext (void)
 
BaseList2DGetPred (void)
 

Bit

void SetBit (Int32 mask)
 
Bool GetBit (Int32 mask) const
 
void DelBit (Int32 mask)
 
void ToggleBit (Int32 mask)
 
Int32 GetAllBits (void) const
 
void SetAllBits (Int32 bits)
 

Container

BaseContainer GetData (void)
 
void SetData (const BaseContainer &bc, Bool add=true)
 
const BaseContainerGetDataInstance (void) const
 
BaseContainerGetDataInstance (void)
 
const BaseContainerGetDataInstanceRef (void) const
 
BaseContainerGetDataInstanceRef (void)
 

Name

const StringGetName (void) const
 
void SetName (const String &name)
 

Miscellaneous

String GetBubbleHelp (void)
 
Bool TransferGoal (BaseList2D *dst, Bool undolink)
 
Bool TransferMarker (BaseList2D *dst) const
 
Bool Scale (Float scale)
 
Bool Edit (void)
 
void GetIcon (IconData *dat)
 
GeListHeadGetNLARoot (void)
 
BaseList2DAnimationLayerRemap (BaseObject **layer=nullptr)
 
const StringGetTypeName (void)
 
BaseList2DGetMain (void) const
 
void InsertTrackSorted (CTrack *track)
 
Bool AddEventNotification (BaseList2D *bl, NOTIFY_EVENT eventid, NOTIFY_EVENT_FLAG flags, const BaseContainer *data)
 
Bool RemoveEventNotification (BaseDocument *doc, BaseList2D *bl, NOTIFY_EVENT eventid)
 
Bool FindEventNotification (BaseDocument *doc, BaseList2D *bl, NOTIFY_EVENT eventid)
 
Bool SetDescIDState (const DescID &id, DESCIDSTATE descidstate)
 
DESCIDSTATE GetDescIDState (const DescID &id, Bool tolerant) const
 
GeListHeadGetOverrideRoot (void)
 
BaseOverrideGetFirstOverride (void)
 
GeListHeadGetShaderRepositoryRoot (void)
 

Marker

void GetMarkerStampEx (UInt32 *l1, UInt32 *l2)
 
const GeMarkerGetMarker (void) const
 
void SetMarker (const GeMarker &m)
 

Unique ID

Bool AddUniqueID (Int32 appid, const Char *const mem, Int bytes)
 
Bool FindUniqueID (Int32 appid, const Char *&mem, Int &bytes) const
 
Int32 GetUniqueIDCount () const
 
Bool GetUniqueIDIndex (Int32 idx, Int32 &id, const Char *&mem, Int &bytes) const
 

Animated Parameter

Bool SetAnimatedParameter (CTrack *track, const DescID &id, const GeData &t_data1, const GeData &t_data2, Float mix, DESCFLAGS_SET flags)
 
Bool GetAnimatedParameter (const DescID &id, GeData &t_data1, GeData &t_data2, Float &mix, DESCFLAGS_GET flags)
 

Shader

BaseShaderGetFirstShader () const
 
void InsertShader (BaseShader *shader, BaseShader *pred=nullptr)
 

Keyframe

void ClearKeyframeSelection ()
 
Bool FindKeyframeSelection (const DescID &id)
 
Bool SetKeyframeSelection (const DescID &id, Bool selection)
 
Bool KeyframeSelectionContent ()
 

Layer

LayerObjectGetLayerObject (BaseDocument *doc)
 
Bool SetLayerObject (LayerObject *layer)
 
const LayerDataGetLayerData (BaseDocument *doc, Bool rawdata=false)
 
Bool SetLayerData (BaseDocument *doc, const LayerData &data)
 

Track

GeListHeadGetCTrackRoot (void)
 
CTrackGetFirstCTrack (void)
 
CTrackFindCTrack (const DescID &id)
 

Additional Inherited Members

- Public Member Functions inherited from GeListNode
GeListNodeGetNext (void)
 
GeListNodeGetPred (void)
 
GeListNodeGetDown (void)
 
GeListNodeGetUp (void)
 
GeListNodeGetDownLast (void)
 
void InsertBefore (GeListNode *bl)
 
void InsertAfter (GeListNode *bl)
 
void InsertUnder (GeListNode *bl)
 
void InsertUnderLast (GeListNode *bl)
 
void Remove (void)
 
GeListHeadGetListHead (void)
 
Int32 GetNodeID (Int32 index=0) const
 
template<typename CAST >
const CAST * GetNodeData (Int32 index=0) const
 
template<typename CAST >
CAST * GetNodeData (Int32 index=0)
 
void SetCustomData (GeListNode *node)
 
GeListNodeGetCustomData (void)
 
BaseDocumentGetDocument (void)
 
Int32 GetBranchInfo (BranchInfo *info, Int32 max, GETBRANCHINFO flags)
 
Bool IsDocumentRelated (void)
 
Int32 GetInfo (void)
 
Bool GetNBit (NBIT bit) const
 
Bool ChangeNBit (NBIT bit, NBITCONTROL bitmode)
 
- Public Member Functions inherited from C4DAtom
Int32 GetType (void) const
 
Int32 GetRealType (void) const
 
Int32 GetDiskType (void) const
 
Bool IsInstanceOf (Int32 id) const
 
Int32 GetClassification (void) const
 
Bool Message (Int32 type, void *data=nullptr)
 
Bool MultiMessage (MULTIMSG_ROUTE flags, Int32 type, void *data)
 
C4DAtomGetClone (COPYFLAGS flags, AliasTrans *trn)
 
Bool CopyTo (C4DAtom *dst, COPYFLAGS flags, AliasTrans *trn)
 
Bool Read (HyperFile *hf, Int32 id, Int32 level)
 
Bool Write (HyperFile *hf)
 
Bool ReadObject (HyperFile *hf, Bool readheader)
 
Bool WriteObject (HyperFile *hf)
 
Bool GetDescription (Description *description, DESCFLAGS_DESC flags)
 
Bool GetParameter (const DescID &id, GeData &t_data, DESCFLAGS_GET flags)
 
Bool SetParameter (const DescID &id, const GeData &t_data, DESCFLAGS_SET flags)
 
DynamicDescriptionGetDynamicDescription ()
 
Bool GetEnabling (const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc)
 
Bool TranslateDescID (const DescID &id, DescID &res_id, C4DAtom *&res_at)
 
UInt32 GetDirty (DIRTYFLAGS flags) const
 
void SetDirty (DIRTYFLAGS flags)
 
UInt32 GetHDirty (HDIRTYFLAGS mask) const
 
void SetHDirty (HDIRTYFLAGS mask)
 

Constructor & Destructor Documentation

§ BaseList2D()

BaseList2D ( )
private

§ ~BaseList2D()

~BaseList2D ( )
private

Member Function Documentation

§ Alloc()

static BaseList2D* Alloc ( Int32  type)
static

Allocates a base list node. Destroy the allocated base list node with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

Parameters
[in]typeA node type ID.

§ Free()

static void Free ( BaseList2D *&  bl)
static

Destructs base list nodes allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.

Parameters
[in,out]blThe base list node to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

§ GetNext()

BaseList2D* GetNext ( void  )

Gets the next BaseList2D in the list. Convenience version of GeListNode::GetNext().

Returns
The next BaseList2D, or nullptr if there is none. Cinema 4D owns the pointed BaseList2D.

§ GetPred()

BaseList2D* GetPred ( void  )

Gets the previous BaseList2D in the list. Convenience version of GeListNode::GetPred().

Returns
The previous BaseList2D, or nullptr if there is none. Cinema 4D owns the pointed BaseList2D.

§ SetBit()

void SetBit ( Int32  mask)

Sets the bits denoted by mask to true.

Parameters
[in]maskThe mask of the bits: BIT

§ GetBit()

Bool GetBit ( Int32  mask) const

Gets the state of the object bits denoted by mask.

Parameters
[in]maskThe mask of the bits: BIT
Returns
The state of the object bits denoted by mask.

§ DelBit()

void DelBit ( Int32  mask)

Deletes the object bits denoted by mask, i.e. sets the corresponding bit to 0.

Parameters
[in]maskThe bit mask of the bits: BIT

§ ToggleBit()

void ToggleBit ( Int32  mask)

Toggles the state of the object bits denoted by the mask.

Parameters
[in]maskThe bit mask of the bits: BIT

§ GetAllBits()

Int32 GetAllBits ( void  ) const

Returns all the object's bits.

Returns
All the object's bits: BIT

§ SetAllBits()

void SetAllBits ( Int32  bits)

Sets all the object's bits at once.

Parameters
[in]bitsThe new object's bits.

§ GetData()

BaseContainer GetData ( void  )

Retrieves a copy of the object's container.

Note
Some objects do not store all their data in the container. For these use GetParameter()/SetParameter() instead.
Here are some built-in objects that do not store everything in the container:
  • CompositingTag
  • DisplayTag
  • ValueKey
  • TextureTag
  • KinematicTag
  • UVWTag
  • LightObject
  • MetaballTag
There are also often some other pieces of information that are not stored in the container, for example:
Most of this information is accessible through other API functions, like for example BaseList2D::GetName().
Returns
The object container.

§ SetData()

void SetData ( const BaseContainer bc,
Bool  add = true 
)

Sets the object container.
By default the contents of bc is added to the existing container; control this behavior with add.

Note
Do not forget to send a message if you change any settings.
Parameters
[in]bcThe container with the new values.
[in]addIf false the values are merged, otherwise the old values are discarded.

§ GetDataInstance() [1/2]

const BaseContainer* GetDataInstance ( void  ) const

Retrieves a pointer to the read-only object container.

See also
GetData()
Returns
A pointer to the read-only internal container. The node owns the pointed container.
Note
The returned pointer is guaranteed to be valid and never nullptr.

§ GetDataInstance() [2/2]

BaseContainer* GetDataInstance ( void  )

Retrieves a pointer to the object container that can be changed directly.

See also
GetData()
Returns
A pointer to the internal container. The node owns the pointed container.
Note
The returned pointer is guaranteed to be valid and never nullptr.

§ GetDataInstanceRef() [1/2]

const BaseContainer& GetDataInstanceRef ( void  ) const

Retrieves a reference to the read-only object container.

Since
R19
See also
GetData()
Returns
A reference to the read-only internal container. The node owns the referenced container.

§ GetDataInstanceRef() [2/2]

BaseContainer& GetDataInstanceRef ( void  )

Retrieves a reference to the object container that can be changed directly.

Since
R19
See also
GetData()
Returns
A reference to the internal container. The node owns the referenced container.

§ GetName()

const String& GetName ( void  ) const

Gets the name of the object.

Returns
The object's name.

§ SetName()

void SetName ( const String name)

Sets the name of the object.

Parameters
[in]nameThe new object's name.

§ GetBubbleHelp()

String GetBubbleHelp ( void  )

Gets the bubble help text for the object.

Returns
The bubble help text.

§ TransferGoal()

Bool TransferGoal ( BaseList2D dst,
Bool  undolink 
)

Transfer goals from the object to dst.
This changes all BaseLink links that point to this object to point to dst instead.

Parameters
[in]dstThe destination. The caller owns the pointed object.
[in]undolinkThis has to be set to false. Private.
Returns
true if the goals could be transfered, otherwise false.

§ TransferMarker()

Bool TransferMarker ( BaseList2D dst) const

Private.

§ GetMarkerStampEx()

void GetMarkerStampEx ( UInt32 l1,
UInt32 l2 
)

Deprecated.

§ GetMarker()

const GeMarker& GetMarker ( void  ) const

Gets the object's marker.

Returns
The object's marker.

§ SetMarker()

void SetMarker ( const GeMarker m)

Sets the object's marker.

Parameters
[in]mThe new object's marker.

§ AddUniqueID()

Bool AddUniqueID ( Int32  appid,
const Char *const  mem,
Int  bytes 
)

Adds a unique application ID data to the object.

Note
This is used for instance to identify scenes written by external applications.
Parameters
[in]appidA unique application ID. It has to be registered at MAXON, at least it should be obtained from http://www.plugincafe.com.
[in]memA pointer to a block of memory, used for instance to store the name of a software vendor.
[in]bytesThe length of the memory block mem.
Returns
true if successful, otherwise false.

§ FindUniqueID()

Bool FindUniqueID ( Int32  appid,
const Char *&  mem,
Int bytes 
) const

Checks for a specific unique application ID data.

Note
This is used for instance to identify scenes written by external applications.
Parameters
[in]appidA unique application ID. It has to be registered at MAXON, at least it should be obtained from http://www.plugincafe.com.
[out]memAssigned a pointer to a block of memory, used for instance to read the name of a software vendor.
[out]bytesAssigned the length of the memory block mem.
Returns
true if the ID could be found, otherwise false.

§ GetUniqueIDCount()

Int32 GetUniqueIDCount ( ) const

Gets the number of unique application IDs.

Returns
The number of unique application IDs.

§ GetUniqueIDIndex()

Bool GetUniqueIDIndex ( Int32  idx,
Int32 id,
const Char *&  mem,
Int bytes 
) const

Gets the idx-th unique application ID data (idx ranging from 0 to GetUniqueIDCount()-1).

Note
This is used for instance to identify scenes written by external applications.
Parameters
[in]idxThe unique ID index.
[out]idAssigned the unique application ID.
[out]memAssigned a pointer to a block of memory, used for instance to read the name of a software vendor.
[out]bytesAssigned the length of the memory block mem.
Returns
true if successful, otherwise false.

§ SetAnimatedParameter()

Bool SetAnimatedParameter ( CTrack track,
const DescID id,
const GeData t_data1,
const GeData t_data2,
Float  mix,
DESCFLAGS_SET  flags 
)

Normally not used. Used by the animator to set the interpolated value along with the right and left value.

Parameters
[in]trackThe animation track. The caller owns the pointed track.
[in]idThe ID of the animated parameter.
[in]t_data1The first data.
[in]t_data2The second data.
[in]mixThe mix value between t_data1 and t_data2.
[in]flagsFlags: DESCFLAGS_SET
Returns
true if the animated parameter was set, otherwise false.

§ GetAnimatedParameter()

Bool GetAnimatedParameter ( const DescID id,
GeData t_data1,
GeData t_data2,
Float mix,
DESCFLAGS_GET  flags 
)

If a parameter is set to MIX animation use this function to retrieve information about it.
For example, the target expression has a link to its current target and when it is animated it slides between the two targets:

EXECUTIONRESULT TargetExpressionTag::Execute(BaseTag* tag, BaseDocument* doc, BaseObject* op, BaseThread* bt, Int32 priority, EXECUTIONFLAGS flags)
{
GeData s1, s2;
Float mix;
BaseList2D *o1 = s1.GetLink(doc);
BaseList2D *o2 = s2.GetLink(doc);
if (!o1 || !o1->IsInstanceOf(Obase))
Vector nrot, p = ((BaseObject*)o1)->GetMg().off;
if (mix>0.0 && o2 && o2->IsInstanceOf(Obase))
p = p * (1.0-mix) + ((BaseObject*)o2)->GetMg().off * mix;
p = p * (!op->GetUpMg());
nrot = VectorToHPB(p - op->GetPos());
nrot.z = op->GetRot().z;
op->SetRot(nrot);
}
Parameters
[in]idThe ID of the parameter.
[in]t_data1Assigned the first data.
[in]t_data2Assigned the second data.
[in]mixAssigned the mix value between t_data1 and t_data2.
[in]flagsFlags: DESCFLAGS_GET
Returns
true if the animated parameter was retrieved, otherwise false.

§ Scale()

Bool Scale ( Float  scale)

Sets the object's scale.
This will scale all parameters with length units by the factor scale.

Parameters
[in]scaleThe scale factor.
Returns
true if the object was scaled successfully, otherwise false.

§ GetFirstShader()

BaseShader* GetFirstShader ( ) const

Retrieves the first shader of the object.

Note
Normally you do not have to deal with the shader list. But if you want to create or modify shader trees via the API read the following lines:
If you are programming shader links to make sure that every shader is referenced only once; it is not allowed that a shader is referenced multiple times.
If the referencing object is a shader the referenced shader must be child of it, otherwise it must be inserted via InsertShader().

Example 1: A tag references a shader. The shader must be inserted into the tag using InsertShader();. Example 2: A Shader (A) references another shader (B): the shader B must be child of the shader A.

Returns
The first shader of the object, or nullptr if there are none. The object owns the pointed shader.

§ InsertShader()

void InsertShader ( BaseShader shader,
BaseShader pred = nullptr 
)

Inserts a shader in the object's shader list.

BaseMaterial *mat = nullptr;
mat = doc->GetFirstMaterial();
if (!mat)
return true;
if (!data)
return true;
if (!shd)
return false;
mat->InsertShader(shd);
mat->Update(true, true);
Parameters
[in]shaderThe shader to insert. The object takes over the ownership of the pointed shader.
[in]predThe shader to insert the new shader after, or nullptr (default)to insert the new shader first. The pointed shader must already be inserted into the list.

§ Edit()

Bool Edit ( void  )

Triggers the edit action for the object.

Note
For most types this brings up the node in the attributes manager. Some still show a separate dialog.
Returns
true if successful, otherwise false.

§ GetIcon()

void GetIcon ( IconData dat)

Gets the icon for the object, by filling dat.

Parameters
[out]datPointer to the icon data to fill. The caller owns the pointed icon data.

§ ClearKeyframeSelection()

void ClearKeyframeSelection ( )

Clears the current keyframe selection.

§ FindKeyframeSelection()

Bool FindKeyframeSelection ( const DescID id)

Checks if id is included in the keyframe selection.

Parameters
[in]idThe description ID to check.
Returns
true if the given id is selected, otherwise false.

§ SetKeyframeSelection()

Bool SetKeyframeSelection ( const DescID id,
Bool  selection 
)

Sets the keyframe selection status of id to selection.

Parameters
[in]idThe description ID to set.
[in]selectiontrue if the element should be included in the keyframe selection, otherwise false.
Returns
A value that should be ignored.

§ KeyframeSelectionContent()

Bool KeyframeSelectionContent ( )

Checks if there is any active keyframe selections.

Note
This is not the same as BIT_ACTIVE; it is the possibility to restrict auto-keyframing to certain description parameters.
See "Animation->Add Keyframe Selection" in the Attribute Manager.
Returns
true if there is a keyframe selection, otherwise false.

§ GetLayerObject()

LayerObject* GetLayerObject ( BaseDocument doc)

Gets the layer of the object.

Parameters
[in]docThe document for the operation.
Returns
The layer, or nullptr.

§ SetLayerObject()

Bool SetLayerObject ( LayerObject layer)

Sets the layer of the object.

Parameters
[in]layerThe new layer.
Returns
true if the layer was successfully set, otherwise false.

§ GetLayerData()

const LayerData* GetLayerData ( BaseDocument doc,
Bool  rawdata = false 
)

Gets the layer data for the object.

Parameters
[in]docThe document for the operation.
[in]rawdataUsually GetLayerData() takes special global modes like SOLO layer automatically into account.
To get the original layer values without any additional global changes set rawdata to true.
Returns
The layer data, or nullptr.

§ SetLayerData()

Bool SetLayerData ( BaseDocument doc,
const LayerData data 
)

Sets the layer data for the object.

Parameters
[in]docThe document for the operation.
[in]dataThe new layer data.
Returns
true if the layer data was successfully set, otherwise false.

§ GetCTrackRoot()

GeListHead* GetCTrackRoot ( void  )

Gets the track root of the object.

Returns
The track root.

§ GetFirstCTrack()

CTrack* GetFirstCTrack ( void  )

Gets the first track of the object.

Returns
The first track, or nullptr if there are no tracks.

§ FindCTrack()

CTrack* FindCTrack ( const DescID id)

Finds the track for the specified description id.

Parameters
[in]idThe description ID for the searched track.
Returns
The found track, or nullptr if there was no match.

§ GetNLARoot()

GeListHead* GetNLARoot ( void  )

Private.

§ AnimationLayerRemap()

BaseList2D* AnimationLayerRemap ( BaseObject **  layer = nullptr)

Retrieves a remapped base list pointer if an active animation layer is existent.
If there is no active layer or no layer at all this will be returned.
Optionally access the layer by passing layer.

Parameters
[out]layerThe current active layer. You can then access the layer properties. Cinema 4D owns the pointed layer object.
Returns
The remapped base list pointer. This is the object of the current active layer. Cinema 4D owns the pointed layer object.

§ GetTypeName()

const String& GetTypeName ( void  )

The name of the object type, for example "Phong", "Spline", "Bone", etc.

Returns
The type name.

§ GetMain()

BaseList2D* GetMain ( void  ) const

Goes up the next level, e.g. from tag to object or XPresso node to tag, or object to document, etc.

Returns
The main object of the object.

§ InsertTrackSorted()

void InsertTrackSorted ( CTrack track)

Inserts a track and automatically places it at the right place (so that Y comes after X for example).

Parameters
[in]trackThe track to insert.

§ AddEventNotification()

Bool AddEventNotification ( BaseList2D bl,
NOTIFY_EVENT  eventid,
NOTIFY_EVENT_FLAG  flags,
const BaseContainer data 
)

Private.

§ RemoveEventNotification()

Bool RemoveEventNotification ( BaseDocument doc,
BaseList2D bl,
NOTIFY_EVENT  eventid 
)

Private.

§ FindEventNotification()

Bool FindEventNotification ( BaseDocument doc,
BaseList2D bl,
NOTIFY_EVENT  eventid 
)

Private.

§ SetDescIDState()

Bool SetDescIDState ( const DescID id,
DESCIDSTATE  descidstate 
)

Sets the state for the description id.

Parameters
[in]idThe description ID.
[in]descidstateThe new description ID state: DESCIDSTATE
Returns
true if the description ID state was successfully set, otherwise false.

§ GetDescIDState()

DESCIDSTATE GetDescIDState ( const DescID id,
Bool  tolerant 
) const

Gets the state of a description id.

Parameters
[in]idThe description ID.
[in]tolerantIf set to true a valid state is returned even though the description ID do not match-completly.
This can be useful for descriptions with several levels. Take this description ID for example: If tolerant is true a valid state is returned even though only the following description ID is passed:
Returns
The description ID state: DESCIDSTATE

§ GetOverrideRoot()

GeListHead* GetOverrideRoot ( void  )

Private.

Since
R17.032

§ GetFirstOverride()

BaseOverride* GetFirstOverride ( void  )

Private.

Since
R17.032

§ GetShaderRepositoryRoot()

GeListHead* GetShaderRepositoryRoot ( void  )

Private.

Since
R17.032