CTrack Class Reference

#include <c4d_ctrack.h>

Inheritance diagram for CTrack:

Public Types

typedef BaseList2D SUPER
 
- Public Types inherited from BaseList2D
typedef GeListNode SUPER
 
- Public Types inherited from GeListNode
typedef PrivateChunk SUPER
 

Public Member Functions

virtual Bool IsInstanceOf (cineware::Int32 id) const
 
- Public Member Functions inherited from BaseList2D
 BaseList2D ()
 
virtual ~BaseList2D ()
 
BaseList2D * GetNext ()
 
BaseList2D * GetPred ()
 
NodeData * GetNodeData ()
 
void SetNodeData (NodeData *data)
 
void SetBit (Int32 mask)
 
Bool GetBit (Int32 mask)
 
void DelBit (Int32 mask)
 
void ToggleBit (Int32 mask)
 
Int32 GetAllBits ()
 
void SetAllBits (Int32 bits)
 
BaseContainer GetData ()
 
BaseContainer * GetDataInstance ()
 
BaseContainer & GetDataInstanceRef ()
 
const String & GetName ()
 
void SetName (const String &new_name)
 
const GeMarker & GetMarker () 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
 
BaseShader * GetFirstShader ()
 
Bool InsertShader (BaseShader *shader, BaseShader *pred=nullptr)
 
Bool InsertShaderLast (BaseShader *shader)
 
RootCTrack * GetCTrackRoot ()
 
CTrack * GetFirstCTrack ()
 
CTrack * FindCTrack (const DescID &id)
 
Bool AppendCTrack (CTrack *t)
 
void InsertTrackSorted (CTrack *track)
 
LayerObject * GetLayerObject ()
 
void SetLayerObject (LayerObject *layer)
 
const LayerData * GetLayerData (BaseDocument *doc, Bool rawdata=false)
 
Bool SetLayerData (BaseDocument *doc, const LayerData &data)
 
DynamicDescription * GetDynamicDescription ()
 
virtual Bool IsBaseList ()
 
Bool SetDescIDState (const DescID &id, DESCIDSTATE descidstate)
 
DESCIDSTATE GetDescIDState (const DescID &id, Bool tolerant) const
 
RootPluginNode * GetOverrideRoot ()
 
BaseOverride * GetFirstOverride ()
 
virtual Bool TranslateDescID (const DescID &id, DescID &res_id, GeListNode *&res_at)
 
- Public Member Functions inherited from GeListNode
 GeListNode ()
 
 ~GeListNode ()
 
virtual Bool GetNBit (Int32 bit) const
 
virtual Bool ChangeNBit (NBIT bit, NBITCONTROL bitmode)
 
BaseDocument * GetDocument ()
 
virtual Int32 GetInfo ()
 
GeListNode * GetPred ()
 
GeListNode * GetNext ()
 
GeListNode * GetUp ()
 
GeListNode * GetDown ()
 
GeListNode * GetDownLast ()
 
void InsertBefore (GeListNode *op)
 
void InsertAfter (GeListNode *op)
 
void Remove ()
 
void InsertUnder (GeListNode *op)
 
void InsertUnderLast (GeListNode *op)
 
RootList2D * GetListHead ()
 
Int32 GetNodeID (Int32 index=0) const
 
- Public Member Functions inherited from PrivateChunk
 PrivateChunk ()
 
Bool ReadChunk (HyperFile *hf, Bool keepin=false, Bool noheader=false)
 
virtual Bool IsListHead ()
 
Bool ReadObject (HyperFile *hf, Bool readheader)
 
Bool WriteObject (HyperFile *hf, Int32 type)
 
Bool CopyTo (PrivateChunk *dest, COPYFLAGS flags, AliasTrans *trans)
 
Bool GetParameter (Int32 id, GeData &data)
 
Bool SetParameter (Int32 id, const GeData &data)
 
Bool GetParameter (const DescID &id, GeData &data)
 
Bool SetParameter (const DescID &id, const GeData &data)
 
virtual Int32 GetChunkLevel ()
 
- Public Member Functions inherited from GeTempPublicNode2D< PrivateChunk >
PrivateChunk * GetNext () const
 
PrivateChunk * GetPrev () const
 
void InsertBefore (PrivateChunk *n)
 
void InsertAfter (PrivateChunk *n)
 
void Remove ()
 

Protected Attributes

BaseList2D * _parentObject
 
- Protected Attributes inherited from BaseList2D
Int32 m_id
 
RootShader mp_rootshader
 
RootShader mp_rootshader_hidden
 
RootShader root_shader_repository
 
Int32 l_bitfeld
 
RootCTrack mp_rootctrack
 
RootPluginNode root_override
 
NotifyList * notify_events
 
DescIdStore * keyframestore
 
DescIdStore * propstore
 
BaseContainer m_bc
 
NodeData * m_data
 
- Protected Attributes inherited from GeListNode
GeAliasGoal m_xgoal
 
UInt32 m_bits [4]
 
RootList2D * t_rootlist_parent
 
RootList2D * m_children
 
BaseDocument * parent_doc
 
void * unknownData
 
Int unknownDataSize
 
Int32 unknownDataLevel
 
Int32 pluginID
 

Private Member Functions

 CTrack ()
 
 ~CTrack ()
 

Private Attributes

CCurve m_curve
 
CCurve * m_hle_base
 
CCurve * m_hle_curve
 
CCurve * m_ss_curve1
 
CCurve * m_ss_curve2
 
CCurve * m_ss_curve3
 
CCurve * m_ss_curve4
 
CCurve * m_ss_curve5
 
CCurve * m_hle_move
 
CCurve * m_hle_scale
 
DescID t_description
 
CLOOP m_before
 
CLOOP m_after
 
BaseLink m_timetrack
 
Int32 m_unit
 
Float m_step
 
Int32 m_HeightTL0
 
Int32 m_HeightTL1
 
Int32 m_HeightTL2
 
Int32 m_HeightTL3
 
PseudoTrackType t_pseudo
 
Bool _synchronized
 

Friends

class CKey
 
class CCurve
 
class RootCTrack
 
class BaseList2D
 

Alloc/Free

static CTrack * Alloc (BaseList2D *bl, const DescID &id, const String &tname)
 
static void Free (CTrack *&bl)
 

Navigation

CTrack * GetNext ()
 
CTrack * GetPred ()
 

Type

virtual Int32 GetType () const
 
virtual Int32 GetDiskType () const
 

Description ID

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

Before/After Loop

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

Time Track

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

Bits

virtual void SetAllBits (Int32 bits)
 
virtual void SetBit (Int32 mask)
 
virtual void DelBit (Int32 mask)
 

Miscellaneous

void FlushData ()
 
virtual BaseList2D * GetClone (COPYFLAGS flags, AliasTrans *trans)
 
CCurve * GetCurve (CCURVE type=CCURVE_CURVE, Bool bCreate=true)
 
Int32 GetTrackCategory () const
 
BaseList2D * GetObject () const
 
Float GetValue (BaseDocument *doc, const BaseTime &time)
 
Bool RemapInternal (Float64 time, Float64 *ret_time, Int32 *cyc, const BaseTime &t1, const BaseTime &t2, Int32 fps) const
 
Bool Remap (Float64 time, Float64 *ret_time, Int32 *ret_cycle) const
 
virtual void Remove ()
 

Private

virtual Bool CopyToX (PrivateChunk *dst, COPYFLAGS flags, AliasTrans *trans)
 
virtual Bool HandleSubChunk (HyperFile *hf, Int32 id, Int32 level)
 
virtual Bool Write (HyperFile *hf)
 
Bool GetDParameter (const DescID &id, GeData &t_data)
 
Bool SetDParameter (const DescID &id, const GeData &t_data)
 
Float GetValue (BaseDocument *doc, const BaseTime &time, Int32 fps, GetValueCache *cache)
 
Bool FindCurve (CCurve *curveToFind, CCURVE &curveType)
 
Bool IsSynchronized () const
 
void SetSynchronized (Bool synch)
 

Additional Inherited Members

- Protected Member Functions inherited from BaseList2D
void SetID (Int32 id)
 
virtual Int32 GetInstanceType () const
 

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
BaseTag* tag = op->MakeTag(Taligntospline);
if (tag)
{
// Allocate track for align to spline tag
CTrack* track = CTrack::Alloc(tag, DescID(ALIGNTOSPLINETAG_POSITION), "atsTrack");
if (track)
{
// Add track to align to spline tag
tag->AppendCTrack(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().

Member Typedef Documentation

◆ SUPER

typedef BaseList2D SUPER

Constructor & Destructor Documentation

◆ CTrack()

CTrack ( )
private

◆ ~CTrack()

~CTrack ( )
private

Member Function Documentation

◆ IsInstanceOf()

virtual Bool IsInstanceOf ( cineware::Int32  id) const
virtual

Reimplemented from BaseList2D.

◆ Alloc()

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

Allocates a track. Destroy the allocated track with Free().

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)), "X")
A track of type LONG is allocated with:
CTrack::Alloc(op, DescLevel(ID_BASEOBJECT_VISIBILITY_EDITOR, DTYPE_LONG, 0), "Visibility")
Plugin and special tracks are allocated passing the ID:
CTrack::Alloc(op, DescLevel(ID, ID, 0), "Plugin Track")
IDs for Cinema 4D's special tracks are CTpla, CTmorph and CTdynamicspline.
[in]tnameThe track name.
Returns
The allocated track, or nullptr if the allocation failed.

◆ Free()

static void Free ( CTrack *&  bl)
static

Destructs tracks allocated with Alloc().

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

◆ GetNext()

CTrack* GetNext ( )

Gets the next track in the list.

Returns
The next track, or nullptr if there is none. Cineware SDK owns the pointed track.

◆ GetPred()

CTrack* GetPred ( )

Gets the previous track in the list.

Returns
The previous track, or nullptr if there is none. Cineware SDK owns the pointed track.

◆ GetType()

virtual Int32 GetType ( ) const
virtual

Gets the type of the track.

See also
BaseList2D::GetType()
Returns
The track type ID.

Reimplemented from BaseList2D.

◆ GetDiskType()

virtual Int32 GetDiskType ( ) const
virtual

Gets the disk type of the track.

See also
BaseList2D::GetDiskType()
Returns
The track disk type ID.

Reimplemented from BaseList2D.

◆ 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 ( ) 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 ( ) 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.

◆ SetAllBits()

virtual void SetAllBits ( Int32  bits)
virtual

Sets all of the track's bit flags at once.

Parameters
[in]bitsThe bits to set.

◆ SetBit()

virtual void SetBit ( Int32  mask)
virtual

Sets the track bit flags denoted by mask to true.

Parameters
[in]maskThe bit mask of the flags.

◆ DelBit()

virtual void DelBit ( Int32  mask)
virtual

Deletes the track bit flags denoted by mask, i.e. set the corresponding bit to false.

Parameters
[in]maskThe bit mask of the flags.

◆ FlushData()

void FlushData ( )

Clears the data.

Note
Empties and resets sequence data but not the keys.

◆ GetClone()

virtual BaseList2D* GetClone ( COPYFLAGS  flags,
AliasTrans *  trans 
)
virtual

Gets a copy of the track.

Parameters
[in]flagsFlags for the clone.
[in]transAn alias translator for the operation. Can be nullptr. The caller owns the pointed object.
Returns
The cloned track. The caller owns the pointed object.

Reimplemented from BaseList2D.

◆ 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 ( ) const

Gets the host object of the track.

Since
18.002
Returns
The host object, or nullptr.

◆ GetValue() [1/2]

Float GetValue ( BaseDocument *  doc,
const BaseTime &  time 
)

Gets the value of the track at time.

Since
17.008 Removed parameter 'fps'.
Parameters
[in]docThe document for the track.
[in]timeThe time.
Returns
The track value.

◆ RemapInternal()

Bool RemapInternal ( Float64  time,
Float64 *  ret_time,
Int32 *  cyc,
const BaseTime &  t1,
const BaseTime &  t2,
Int32  fps 
) const

Private.

◆ 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 successful, otherwise false.

◆ Remove()

virtual void Remove ( )
virtual

Removes the track from its list.

Warning
When a track is removed the owner become responsible for freeing it or passing its ownership to another list.

Reimplemented from BaseList2D.

◆ CopyToX()

virtual Bool CopyToX ( PrivateChunk *  dst,
COPYFLAGS  flags,
AliasTrans *  trans 
)
virtual

Private.

Reimplemented from BaseList2D.

◆ HandleSubChunk()

virtual Bool HandleSubChunk ( HyperFile *  hf,
Int32  id,
Int32  level 
)
virtual

Private.

Reimplemented from BaseList2D.

◆ Write()

virtual Bool Write ( HyperFile *  hf)
virtual

Private.

Reimplemented from BaseList2D.

◆ GetDParameter()

Bool GetDParameter ( const DescID &  id,
GeData &  t_data 
)
virtual

Private.

Reimplemented from BaseList2D.

◆ SetDParameter()

Bool SetDParameter ( const DescID &  id,
const GeData &  t_data 
)
virtual

Private.

Reimplemented from BaseList2D.

◆ GetValue() [2/2]

Float GetValue ( BaseDocument *  doc,
const BaseTime &  time,
Int32  fps,
GetValueCache *  cache 
)

Private.

◆ FindCurve()

Bool FindCurve ( CCurve *  curveToFind,
CCURVE &  curveType 
)

Private.

◆ IsSynchronized()

Bool IsSynchronized ( ) const

Private.

◆ SetSynchronized()

void SetSynchronized ( Bool  synch)

Private.

Friends And Related Function Documentation

◆ CKey

friend class CKey
friend

◆ CCurve

friend class CCurve
friend

◆ RootCTrack

friend class RootCTrack
friend

◆ BaseList2D

friend class BaseList2D
friend

Member Data Documentation

◆ _parentObject

BaseList2D* _parentObject
protected

◆ m_curve

CCurve m_curve
private

◆ m_hle_base

CCurve* m_hle_base
private

◆ m_hle_curve

CCurve* m_hle_curve
private

◆ m_ss_curve1

CCurve* m_ss_curve1
private

◆ m_ss_curve2

CCurve* m_ss_curve2
private

◆ m_ss_curve3

CCurve* m_ss_curve3
private

◆ m_ss_curve4

CCurve* m_ss_curve4
private

◆ m_ss_curve5

CCurve* m_ss_curve5
private

◆ m_hle_move

CCurve* m_hle_move
private

◆ m_hle_scale

CCurve* m_hle_scale
private

◆ t_description

DescID t_description
private

◆ m_before

CLOOP m_before
private

◆ m_after

CLOOP m_after
private

◆ m_timetrack

BaseLink m_timetrack
private

◆ m_unit

Int32 m_unit
private

◆ m_step

Float m_step
private

◆ m_HeightTL0

Int32 m_HeightTL0
private

◆ m_HeightTL1

Int32 m_HeightTL1
private

◆ m_HeightTL2

Int32 m_HeightTL2
private

◆ m_HeightTL3

Int32 m_HeightTL3
private

◆ t_pseudo

PseudoTrackType t_pseudo
private

◆ _synchronized

Bool _synchronized
private
ID_BASEOBJECT_VISIBILITY_EDITOR
@ ID_BASEOBJECT_VISIBILITY_EDITOR
Definition: obase.h:7
Taligntospline
#define Taligntospline
Align to spline.
Definition: c4d_parameter_ids.h:845
cineware::CTrack::CCurve
friend class CCurve
Definition: c4d_ctrack.h:108
cineware::CTrack::Alloc
static CTrack * Alloc(BaseList2D *bl, const DescID &id, const String &tname)
cineware::VECTOR_X
@ VECTOR_X
Definition: private_symbols.h:859
cineware::CTrack::CKey
friend class CKey
Definition: c4d_ctrack.h:107
ALIGNTOSPLINETAG_POSITION
@ ALIGNTOSPLINETAG_POSITION
Definition: taligntospline.h:9
cineware::DTYPE_VECTOR
@ DTYPE_VECTOR
Vector
Definition: c4d_parameter_ids.h:417
cineware::DTYPE_LONG
@ DTYPE_LONG
Int32
Definition: c4d_parameter_ids.h:414
cineware::CTrack::CTrack
CTrack()
cineware::DTYPE_REAL
@ DTYPE_REAL
Float
Definition: c4d_parameter_ids.h:415