CTrack Class Reference

#include <c4d_canimation.h>

Inheritance diagram for CTrack:

Detailed Description

Represents an animation track.
Contains curves holding keys.
Example: Creating Align to Spline tag and adding track with 2 keys:

// Add align to spline tag to object
if (tag)
// Allocate track for align to spline tag
if (track)
// Add track to align to spline tag
// Get track curve
CCurve* curve = track->GetCurve();
if (curve!=nullptr)
// Add first key
CKey* key = curve->AddKey(BaseTime(0.0));
key->SetValue(curve, 0.0);
// Add second key
key = curve->AddKey(BaseTime(1.0));
key->SetValue(curve, 0.9);
Has to be created with Alloc() and destroyed with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

Private Member Functions

 CTrack ()
 ~CTrack (void)


static CTrackAlloc (BaseList2D *bl, const DescID &id)
static void Free (CTrack *&bl)


CTrackGetNext () const
CTrackGetPred () const

Description ID

const DescIDGetDescriptionID () const
Bool SetDescriptionID (BaseList2D *object, const DescID &id)

Before/After Loop

CLOOP GetBefore (void) const
void SetBefore (CLOOP type)
CLOOP GetAfter (void) const
void SetAfter (CLOOP type)

Time Track

CTrackGetTimeTrack (BaseDocument *doc)
void SetTimeTrack (CTrack *track)


Bool AnimateTrack (BaseDocument *doc, BaseList2D *op, const BaseTime &tt, const Int32 flags, Bool *chg, void *data=nullptr)
Bool Animate (const CAnimInfo *info, Bool *chg, void *data=nullptr)
Bool Draw (GeClipMap *map, const BaseTime &clip_left, const BaseTime &clip_right) const
Bool FillKey (BaseDocument *doc, BaseList2D *bl, CKey *key)
void FlushData (void)
CCurveGetCurve (CCURVE type=CCURVE_CURVE, Bool bCreate=true)
Int32 GetTrackCategory () const
BaseList2DGetObject () const
Float GetValue (BaseDocument *doc, const BaseTime &time)
Int32 GetUnit (Float *step)
const BaseContainerGetParameterDescription (BaseContainer &temp) const
Int32 GuiMessage (const BaseContainer &msg, BaseContainer &result)
Bool Remap (Float64 time, Float64 *ret_time, Int32 *ret_cycle) const
Bool TrackInformation (BaseDocument *doc, CKey *key, String *str, Bool set)


Int32 GetHeight ()
Int32 GetTLHeight (Int32 id)
void SetTLHeight (Int32 id, Int32 size)


Bool IsSynchronized () const
void SetSynchronized (Bool synch)

Additional Inherited Members

- Public Member Functions inherited from BaseList2D
BaseList2DGetNext (void)
BaseList2DGetPred (void)
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)
BaseContainer GetData (void)
void SetData (const BaseContainer &bc, Bool add=true)
const BaseContainerGetDataInstance (void) const
BaseContainerGetDataInstance (void)
const BaseContainerGetDataInstanceRef (void) const
BaseContainerGetDataInstanceRef (void)
const StringGetName (void) const
void SetName (const String &name)
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)
void GetMarkerStampEx (UInt32 *l1, UInt32 *l2)
const GeMarkerGetMarker (void) const
void SetMarker (const GeMarker &m)
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
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)
BaseShaderGetFirstShader () const
void InsertShader (BaseShader *shader, BaseShader *pred=nullptr)
void ClearKeyframeSelection ()
Bool FindKeyframeSelection (const DescID &id)
Bool SetKeyframeSelection (const DescID &id, Bool selection)
Bool KeyframeSelectionContent ()
LayerObjectGetLayerObject (BaseDocument *doc)
Bool SetLayerObject (LayerObject *layer)
const LayerDataGetLayerData (BaseDocument *doc, Bool rawdata=false)
Bool SetLayerData (BaseDocument *doc, const LayerData &data)
GeListHeadGetCTrackRoot (void)
CTrackGetFirstCTrack (void)
CTrackFindCTrack (const DescID &id)
- 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)
- Static Public Member Functions inherited from BaseList2D
static BaseList2DAlloc (Int32 type)
static void Free (BaseList2D *&bl)

Constructor & Destructor Documentation

§ CTrack()

CTrack ( )

§ ~CTrack()

~CTrack ( void  )

Member Function Documentation

§ Alloc()

static CTrack* Alloc ( BaseList2D bl,
const DescID id 

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

[in]blThe object to allocate the track for.
[in]idThe description ID to allocate the track for.
For instance a position track is allocated with:
A track of type LONG is allocated with: Plugin and special tracks are allocated passing the ID:
CTrack::Alloc(op, DescLevel(ID, ID, 0))
IDs for Cinema 4D's special tracks are: TrackTypes
The allocated track, or nullptr if the allocation failed.

§ Free()

static void Free ( CTrack *&  bl)

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

[in]blThe track to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

§ GetNext()

CTrack* GetNext ( void  ) const

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

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

§ GetPred()

CTrack* GetPred ( void  ) const

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

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

§ GetDescriptionID()

const DescID& GetDescriptionID ( ) const

Gets the description ID of the track.

The description ID.

§ SetDescriptionID()

Bool SetDescriptionID ( BaseList2D object,
const DescID id 

Sets the description ID of the track.

[in]objectThe object for the track. The caller owns the pointed object.
[in]idThe description ID of the track to set.
true if successful, otherwise false.

§ GetBefore()

CLOOP GetBefore ( void  ) const

Gets the pre-track loop type.

The before loop type.

§ SetBefore()

void SetBefore ( CLOOP  type)

Sets the pre-track loop type.

[in]typeThe before loop type to set.

§ GetAfter()

CLOOP GetAfter ( void  ) const

Gets the post-track loop type.

The after loop type.

§ SetAfter()

void SetAfter ( CLOOP  type)

Sets the post-track loop type.

[in]typeThe after loop type to set.

§ GetTimeTrack()

CTrack* GetTimeTrack ( BaseDocument doc)

Gets the time track.

[in]docThe document for the operation.
The time track.

§ SetTimeTrack()

void SetTimeTrack ( CTrack track)

Sets the time track.

[in]trackThe time track to set.

§ AnimateTrack()

Bool AnimateTrack ( BaseDocument doc,
BaseList2D op,
const BaseTime tt,
const Int32  flags,
Bool chg,
void *  data = nullptr 


§ Animate()

Bool Animate ( const CAnimInfo info,
Bool chg,
void *  data = nullptr 


§ Draw()

Bool Draw ( GeClipMap map,
const BaseTime clip_left,
const BaseTime clip_right 
) const

Draws the track into a clip map, if drawing is supported.

[out]mapThe clip map to draw into. The caller owns the pointed clip map.
[in]clip_leftThe left clipping.
[in]clip_rightThe right clipping.
true if the track was drawn, otherwise false.

§ FillKey()

Bool FillKey ( BaseDocument doc,
BaseList2D bl,
CKey key 

Fills key with default values.

[in]docThe document. The caller owns the pointed document.
[in]blThe base list of the key to fill. The caller owns the pointed object.
[out]keyThe key to fill. The caller owns the pointed key.
true if key was filled, otherwise false.

§ FlushData()

void FlushData ( void  )

Flushes the data.

Empties and resets sequence data but not the keys.

§ GetCurve()

CCurve* GetCurve ( CCURVE  type = CCURVE_CURVE,
Bool  bCreate = true 

Gets a curve of the track.

[in]typeThe curve type: CCURVE
[in]bCreateIf true a curve is created if none exists.
The curve. Can be nullptr if type is something else than CCURVE_CURVE.

§ GetTrackCategory()

Int32 GetTrackCategory ( ) const

Gets the track category.

The track category: CTRACK_CATEGORY.

§ GetObject()

BaseList2D* GetObject ( void  ) const

Gets the host object of the track.

The host object, or nullptr.

§ GetValue()

Float GetValue ( BaseDocument doc,
const BaseTime time 

Gets the value of the track at time.

[in]docThe document for the track.
[in]timeThe time.
The track value.

§ GetUnit()

Int32 GetUnit ( Float step)

Gets the unit and step of the track.

[out]stepAssigned the step.
The unit: UNIT

§ GetParameterDescription()

const BaseContainer* GetParameterDescription ( BaseContainer temp) const


§ GuiMessage()

Int32 GuiMessage ( const BaseContainer msg,
BaseContainer result 

Sends a GUI message to the track.

See also
The article GUI Messages for more information.
[in]msgThe GUI message container.
[out]resultThe result container.
The result.

§ Remap()

Bool Remap ( Float64  time,
Float64 ret_time,
Int32 ret_cycle 
) const

Remaps time.

[in]timeThe input time.
[out]ret_timeThe output time.
[out]ret_cycleThe output cycle.
true if time was remapped, otherwise false.

§ TrackInformation()

Bool TrackInformation ( BaseDocument doc,
CKey key,
String str,
Bool  set 

Gets or sets track information at the current time, or at key if specified.
The information in str is displayed in tooltips etc.

[in]docThe document. The caller owns the pointed document.
[in]keyThe optional key. The caller owns the pointed key.
[in,out]strThe information string to get or set. The caller owns the pointed string.
[in]setIf true the information is set, otherwise it is retrieved.
true if track information was retrieved or set, otherwise false.

§ GetHeight()

Int32 GetHeight ( )

Gets the height of the track.

The height of the track in pixels.

§ GetTLHeight()

Int32 GetTLHeight ( Int32  id)

Gets the height of the mini F-Curves in the Timeline.

[in]idPass a value between 0-3 for one of the four Timelines.
The height of the mini F-curve in pixels.

§ SetTLHeight()

void SetTLHeight ( Int32  id,
Int32  size 

Sets the height of the mini F-Curves in the Timeline.

[in]idPass a value between 0-3 for one of the four Timelines.
[in]sizeThe new size of the mini F-Curves in pixels.

§ IsSynchronized()

Bool IsSynchronized ( ) const

Checks if keys are synchronized with other Component tracks (Vector Track only).

true if track is synchronized, otherwise false.

§ SetSynchronized()

void SetSynchronized ( Bool  synch)

Sets synchronization between component Track (Vector Track only).

[in]synchtrue if Track needs to be synchronized, otherwise false.