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
tag->InsertTrackSorted(track);
// 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);
}
}
}
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

 CTrack ()
 
 ~CTrack (void)
 

Alloc/Free

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

Navigation

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)
 

Miscellaneous

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)
 

height

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

Synchronization

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 ( )
private

§ ~CTrack()

~CTrack ( void  )
private

Member Function Documentation

§ Alloc()

static CTrack* Alloc ( BaseList2D bl,
const DescID id 
)
static

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

Parameters
[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:
CTrack::Alloc(op, DescID(DescLevel(ID_BASEOBJECT_POSITION, DTYPE_VECTOR, 0), DescLevel(VECTOR_X, DTYPE_REAL, 0)))
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
Returns
The allocated track, or nullptr if the allocation failed.

§ Free()

static void Free ( CTrack *&  bl)
static

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

Parameters
[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()

Returns
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()

Returns
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.

Returns
The description ID.

§ SetDescriptionID()

Bool SetDescriptionID ( BaseList2D object,
const DescID id 
)

Sets the description ID of the track.

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

§ GetBefore()

CLOOP GetBefore ( void  ) const

Gets the pre-track loop type.

Returns
The before loop type.

§ SetBefore()

void SetBefore ( CLOOP  type)

Sets the pre-track loop type.

Parameters
[in]typeThe before loop type to set.

§ GetAfter()

CLOOP GetAfter ( void  ) const

Gets the post-track loop type.

Returns
The after loop type.

§ SetAfter()

void SetAfter ( CLOOP  type)

Sets the post-track loop type.

Parameters
[in]typeThe after loop type to set.

§ GetTimeTrack()

CTrack* GetTimeTrack ( BaseDocument doc)

Gets the time track.

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

§ SetTimeTrack()

void SetTimeTrack ( CTrack track)

Sets the time track.

Parameters
[in]trackThe time track to set.

§ AnimateTrack()

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

Internal.

§ Animate()

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

Internal.

§ 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.

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

§ FillKey()

Bool FillKey ( BaseDocument doc,
BaseList2D bl,
CKey key 
)

Fills key with default values.

Parameters
[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.
Returns
true if key was filled, otherwise false.

§ FlushData()

void FlushData ( void  )

Flushes the data.

Note
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.

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

§ GetTrackCategory()

Int32 GetTrackCategory ( ) const

Gets the track category.

Returns
The track category: CTRACK_CATEGORY.

§ GetObject()

BaseList2D* GetObject ( void  ) const

Gets the host object of the track.

Returns
The host object, or nullptr.

§ GetValue()

Float GetValue ( BaseDocument doc,
const BaseTime time 
)

Gets the value of the track at time.

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

§ GetUnit()

Int32 GetUnit ( Float step)

Gets the unit and step of the track.

Parameters
[out]stepAssigned the step.
Returns
The unit: UNIT

§ GetParameterDescription()

const BaseContainer* GetParameterDescription ( BaseContainer temp) const

Private.

§ GuiMessage()

Int32 GuiMessage ( const BaseContainer msg,
BaseContainer result 
)

Sends a GUI message to the track.

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

§ Remap()

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

Remaps time.

Parameters
[in]timeThe input time.
[out]ret_timeThe output time.
[out]ret_cycleThe output cycle.
Returns
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.

Parameters
[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.
Returns
true if track information was retrieved or set, otherwise false.

§ GetHeight()

Int32 GetHeight ( )

Gets the height of the track.

Returns
The height of the track in pixels.

§ GetTLHeight()

Int32 GetTLHeight ( Int32  id)

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

Parameters
[in]idPass a value between 0-3 for one of the four Timelines.
Returns
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.

Parameters
[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).

Since
R18
Returns
true if track is synchronized, otherwise false.

§ SetSynchronized()

void SetSynchronized ( Bool  synch)

Sets synchronization between component Track (Vector Track only).

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