CTrack Class Reference

#include <c4d_canimation.h>

Inheritance diagram for CTrack:

详细描述

Represents an animation track.
Contains curves holding keys .
范例: 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 )); 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); } } }

注意
Has to be created with Alloc() and destroyed with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

私有成员函数

  CTrack ()
  ~CTrack (void)

Alloc/Free

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

导航

CTrack GetNext () const
CTrack GetPred () const

Description ID

const DescID GetDescriptionID () 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

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

杂项

Bool   AnimateTrack ( BaseDocument *doc, BaseList2D *op, const BaseTime &tt, ANIMATEFLAGS flags, Bool *chg, void *data=nullptr)
Bool   动画 (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)
CCurve GetCurve ( CCURVE type= CCURVE::CURVE , Bool bCreate=true)
Int32   GetTrackCategory () const
BaseList2D GetObject () const
Float   GetValue ( BaseDocument *doc, const BaseTime &time)
Int32   GetUnit ( Float *step)
const BaseContainer GetParameterDescription ( 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, maxon::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
const Char GetViewportRenderId ( VIEWPORT_RENDER_ID typeId) const
BaseList2D GetNext ()
BaseList2D GetPred ()
void  SetBit ( Int32 mask)
Bool   GetBit ( Int32 mask) const
void  DelBit ( Int32 mask)
void  ToggleBit ( Int32 mask)
Int32   GetAllBits () const
void  SetAllBits ( Int32 bits)
void  SetBitEx ( Int32 mask, Int32 flags)
BaseContainer   GetData ()
void  SetData (const BaseContainer &bc, Bool add=true)
const BaseContainer GetDataInstance () const
BaseContainer GetDataInstance ()
const BaseContainer GetDataInstanceRef () const
BaseContainer GetDataInstanceRef ()
String   GetName () const
void  SetName (const maxon::String &name)
String   GetBubbleHelp ()
Bool   TransferGoal ( BaseList2D *dst, Bool undolink)
Bool   TransferMarker ( BaseList2D *dst) const
Bool   比例 ( Float scale)
Bool   编辑 ()
void  GetIcon ( IconData *dat)
GeListHead GetNLARoot ()
BaseList2D AnimationLayerRemap ( BaseObject **layer=nullptr)
String   GetTypeName ()
BaseList2D GetMain () 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
GeListHead GetOverrideRoot ()
BaseOverride GetFirstOverride ()
GeListHead GetShaderRepositoryRoot ()
GeListHead GetHiddenShaderRoot ()
maxon::NimbusInterface *  GetNimbusRef (const maxon::Id &spaceId) const
maxon::Result < maxon::NimbusInterface * >  GetOrCreateNimbusRef (const maxon::Id &spaceId)
void  RemoveNimbusRef (const maxon::Id &spaceId)
maxon::Result < maxon::HashMap < maxon::Id , maxon::ForwardRef < maxon::NimbusRef > > >  GetAllNimbusRefs () const
Bool   IsNodeBased () const
void  GetMarkerStampEx ( UInt32 *l1, UInt32 *l2)
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
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)
BaseShader GetFirstShader () const
void  InsertShader ( BaseShader *shader, BaseShader *pred=nullptr)
void  ClearKeyframeSelection ()
Bool   FindKeyframeSelection (const DescID &id)
Bool   SetKeyframeSelection (const DescID &id, Bool selection)
Bool   KeyframeSelectionContent ()
LayerObject GetLayerObject ( BaseDocument *doc)
Bool   SetLayerObject ( LayerObject *layer)
const LayerData GetLayerData ( BaseDocument *doc, Bool rawdata=false)
Bool   SetLayerData ( BaseDocument *doc, const LayerData &data)
GeListHead GetCTrackRoot ()
CTrack GetFirstCTrack ()
CTrack FindCTrack (const DescID &id)
-  Public Member Functions inherited from GeListNode
GeListNode GetNext ()
GeListNode GetPred ()
GeListNode GetDown ()
GeListNode GetUp ()
GeListNode GetDownLast ()
void  InsertBefore ( GeListNode *bl)
void  InsertAfter ( GeListNode *bl)
void  InsertUnder ( GeListNode *bl)
void  InsertUnderLast ( GeListNode *bl)
void  移除 ()
GeListHead GetListHead ()
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)
GeListNode GetCustomData ()
BaseDocument GetDocument ()
Int32   GetBranchInfo ( BranchInfo *info, Int32 max, GETBRANCHINFO flags)
Bool   IsDocumentRelated ()
Int32   GetInfo ()
Bool   GetNBit ( NBIT bit) const
UInt32   GetNBitMask ( Int32 index) const
Bool   ChangeNBit ( NBIT bit, NBITCONTROL bitmode)
-  Public Member Functions inherited from C4DAtom
Int32   GetType () const
Int32   GetRealType () const
Int32   GetDiskType () const
Bool   IsInstanceOf ( Int32 id) const
Int32   GetClassification () const
Bool   消息 ( Int32 type, void *data=nullptr)
Bool   MultiMessage ( MULTIMSG_ROUTE flags, Int32 type, void *data)
C4DAtom GetClone ( COPYFLAGS flags, AliasTrans *trn)
Bool   CopyTo ( C4DAtom *dst, COPYFLAGS flags, AliasTrans *trn)
Bool   读取 ( HyperFile *hf, Int32 id, Int32 level)
Bool   Write ( HyperFile *hf)
Bool   ReadObject ( HyperFile *hf, Bool readheader)
Bool   WriteObject ( HyperFile *hf)
Bool   GetDescription ( 描述 *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)
DynamicDescription GetDynamicDescription ()
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 BaseList2D Alloc ( Int32 type)
static void  Free ( BaseList2D *&bl)
-  Static Public Attributes inherited from BaseList2D
static const Int32   SETBIT_FLAG_NODIRTY
static const Int32   SETBIT_FLAG_REMOVE

构造函数 & 析构函数文档编制

◆  CTrack()

CTrack () private

◆  ~CTrack()

~ CTrack ( void  )
private

成员函数文档编制

◆  Alloc()

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

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

参数
[in] bl The object to allocate the track for.
[in] id The 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: CTrack::Alloc (op, DescLevel ( ID_BASEOBJECT_VISIBILITY_EDITOR , DTYPE_LONG , 0)) 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 )
static

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

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

◆  GetNext()

CTrack * GetNext ( ) 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 ( ) 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] object The object for the track. The caller owns the pointed object.
[in] id The 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] type The 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] type The after loop type to set.

◆  GetTimeTrack()

CTrack * GetTimeTrack ( BaseDocument doc )

Gets the time track.

参数
[in] doc The document for the operation.
返回
The time track.

◆  SetTimeTrack()

void SetTimeTrack ( CTrack track )

Sets the time track.

参数
[in] track The time track to set.

◆  AnimateTrack()

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

Internal .

◆  Animate()

Bool 动画 ( 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.

参数
[out] map The clip map to draw into. The caller owns the pointed clip map.
[in] clip_left The left clipping.
[in] clip_right The 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] doc The document. The caller owns the pointed document.
[in] bl The base list of the key to fill. The caller owns the pointed object.
[out] key The 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] type The curve type: CCURVE
[in] bCreate 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 ( ) 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] doc The document for the track.
[in] time The time.
返回
The track value.

◆  GetUnit()

Int32 GetUnit ( Float step )

Gets the unit and step of the track.

参数
[out] step Assigned the step.
返回
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.

另请参阅
The article GUI Messages 了解更多信息。
参数
[in] msg The GUI message container.
[out] result The result container.
返回
The result.

◆  Remap()

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

Remaps time .

参数
[in] time The input time.
[out] ret_time The output time.
[out] ret_cycle The output cycle.
返回
true if time was remapped, otherwise false .

◆  TrackInformation()

Bool TrackInformation ( BaseDocument doc ,
CKey key ,
maxon::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] doc The document. The caller owns the pointed document.
[in] key The optional key. The caller owns the pointed key.
[in,out] str The information string to get or set. The caller owns the pointed string.
[in] set 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] id Pass 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] id Pass a value between 0-3 for one of the four Timelines.
[in] size The 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).

由于
R18
返回
true if track is synchronized, otherwise false .

◆  SetSynchronized()

void SetSynchronized ( Bool   synch )

Sets synchronization between component Track (Vector Track only).

由于
R18
参数
[in] synch true if Track needs to be synchronized, otherwise false .
ALIGNTOSPLINETAG_POSITION
@ ALIGNTOSPLINETAG_POSITION
定义: taligntospline.h:9
Taligntospline
#define Taligntospline
Align to spline.
定义: ge_prepass.h:1263
CTrack::Alloc
static CTrack * Alloc(BaseList2D *bl, const DescID &id)
BaseTime
定义: c4d_basetime.h:24
CKey::SetValue
void SetValue(CCurve *seq, Float v)
定义: c4d_canimation.h:157
DescID
定义: lib_description.h:327
ID_BASEOBJECT_VISIBILITY_EDITOR
@ ID_BASEOBJECT_VISIBILITY_EDITOR
定义: obase.h:7
VECTOR_X
@ VECTOR_X
X component.
定义: lib_description.h:267
CCurve
定义: c4d_canimation.h:354
BaseTag
定义: c4d_basetag.h:46
BaseList2D::InsertTrackSorted
void InsertTrackSorted(CTrack *track)
CCurve::AddKey
CKey * AddKey(const BaseTime &time, Int32 *nidx=nullptr, Bool bUndo=false, Bool SynchronizeKeys=false)
定义: c4d_canimation.h:412
CTrack
定义: c4d_canimation.h:640
BaseObject::MakeTag
BaseTag * MakeTag(Int32 type, BaseTag *pred=nullptr)
DTYPE_VECTOR
@ DTYPE_VECTOR
向量
定义: lib_description.h:70
DescLevel
Represents a level within a DescID.
定义: lib_description.h:286
DTYPE_LONG
@ DTYPE_LONG
Int32
定义: lib_description.h:67
CKey
定义: c4d_canimation.h:57
DTYPE_REAL
@ DTYPE_REAL
Float
定义: lib_description.h:68
CTrack::GetCurve
CCurve * GetCurve(CCURVE type=CCURVE::CURVE, Bool bCreate=true)
定义: c4d_canimation.h:805