CKey Class Reference

#include <c4d_canimation.h>

Inheritance diagram for CKey:

Detailed Description

Represents the animation key.
Can be inserted into the curve of a track.

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

 CKey ()
 
 ~CKey (void)
 
const CKeyoperator= (const CKey &key)
 

Alloc/Free

static CKeyAlloc ()
 
static void Free (CKey *&key)
 

Get/Set Time

BaseTime GetTime (void) const
 
void SetTime (CCurve *seq, const BaseTime &t)
 
BaseTime GetTimeLeft (void) const
 
void SetTimeLeft (CCurve *seq, const BaseTime &t)
 
BaseTime GetTimeRight (void) const
 
void SetTimeRight (CCurve *seq, const BaseTime &t)
 

Get/Set Value

Float GetValue (void) const
 
void SetValue (CCurve *seq, Float v)
 
const GeDataGetGeData (void) const
 
void SetGeData (CCurve *seq, const GeData &d)
 
Float GetValueLeft (void) const
 
void SetValueLeft (CCurve *seq, Float v)
 
Float GetValueRight (void) const
 
void SetValueRight (CCurve *seq, Float v)
 

Interpolation

CINTERPOLATION GetInterpolation (void) const
 
void SetInterpolation (CCurve *seq, CINTERPOLATION inter)
 
ROTATIONINTERPOLATION_QUATERNION GetQuatInterpolation (void) const
 
void SetQuatInterpolation (CCurve *seq, ROTATIONINTERPOLATION_QUATERNION inter, Bool bUndo=true)
 

Copy/Clone

Bool CopyDataTo (CCurve *destseq, CKey *dest, AliasTrans *trans) const
 
CKeyGetClone (AliasTrans *trans) const
 

Miscellaneous

CTrackGetTrack (void)
 
CCurveGetCurve (void)
 
void FlushData (void)
 

AutoTangent Mode

CAUTOMODE GetAutomaticTangentMode (void) const
 
void SetAutomaticTangentMode (CCurve *seq, CAUTOMODE autoMode)
 

Tangent Helpers

Bool SetTimeLeftAdjustValue (CCurve *seq, const BaseTime &t)
 
Bool SetTimeRightAdjustValue (CCurve *seq, const BaseTime &t)
 

Key Preset Mode

CKEYPRESET GetKeyPreset (void) const
 
void SetKeyPreset (CCurve *seq, CKEYPRESET preset)
 

Additional Inherited Members

- Public Member Functions inherited from GeListNode
GeListNodeGetNext ()
 
GeListNodeGetPred ()
 
GeListNodeGetDown ()
 
GeListNodeGetUp ()
 
GeListNodeGetDownLast ()
 
void InsertBefore (GeListNode *bl)
 
void InsertAfter (GeListNode *bl)
 
void InsertUnder (GeListNode *bl)
 
void InsertUnderLast (GeListNode *bl)
 
void Remove ()
 
GeListHeadGetListHead ()
 
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 ()
 
BaseDocumentGetDocument ()
 
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 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

◆ CKey()

CKey ( )
private

◆ ~CKey()

~CKey ( void  )
private

Member Function Documentation

◆ operator=()

const CKey& operator= ( const CKey key)
private

◆ Alloc()

static CKey* Alloc ( void  )
static

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

Returns
The allocated key, or nullptr if the allocation failed.

◆ Free()

static void Free ( CKey *&  key)
static

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

Parameters
[in,out]keyThe key to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆ GetTime()

BaseTime GetTime ( void  ) const

Gets the time of the key.

Returns
The time.

◆ SetTime()

void SetTime ( CCurve seq,
const BaseTime t 
)

Sets the time of the key.

Parameters
[in]seqThe curve the key belongs to.
[in]tThe time to set.

◆ GetTimeLeft()

BaseTime GetTimeLeft ( void  ) const

Gets the left time of the key.

Returns
The left time.

◆ SetTimeLeft()

void SetTimeLeft ( CCurve seq,
const BaseTime t 
)

Sets the left time of the key.

Parameters
[in]seqThe curve the key belongs to.
[in]tThe left time to set.

◆ GetTimeRight()

BaseTime GetTimeRight ( void  ) const

Gets the right time of the key.

Returns
The right time.

◆ SetTimeRight()

void SetTimeRight ( CCurve seq,
const BaseTime t 
)

Sets the right time of the key.

Parameters
[in]seqThe curve the key belongs to.
[in]tThe right time to set.

◆ GetValue()

Float GetValue ( void  ) const

Gets the value of the key.

Note
Use GetParameter() to read non-real values.
Example: Reading of PLA keys.
GeData data;
if (!key->GetParameter(DescLevel(CK_PLA_DATA,CUSTOMDATATYPE_PLA,0), data, 0))
return false;
if (pla==nullptr)
return false;
VariableTag *ptag = nullptr,
*htag = nullptr;
pla->GetVariableTags(ptag, htag);
ptag/htag contain the point/tangent information.
Returns
The value.

◆ SetValue()

void SetValue ( CCurve seq,
Float  v 
)

Sets the value of the key.

Parameters
[in]seqThe curve the key belongs to.
[in]vThe value to set.

◆ GetGeData()

const GeData& GetGeData ( void  ) const

Gets the data of the key.

Returns
The data.

◆ SetGeData()

void SetGeData ( CCurve seq,
const GeData d 
)

Sets the data of the key.

Parameters
[in]seqThe curve the key belongs to.
[in]dThe new key data.

◆ GetValueLeft()

Float GetValueLeft ( void  ) const

Gets the left value of the key.

Returns
The left value.

◆ SetValueLeft()

void SetValueLeft ( CCurve seq,
Float  v 
)

Sets the left value of the key.

Parameters
[in]seqThe curve the key belongs to.
[in]vThe left value to set.

◆ GetValueRight()

Float GetValueRight ( void  ) const

Gets the right value of the key.

Returns
The right value.

◆ SetValueRight()

void SetValueRight ( CCurve seq,
Float  v 
)

Sets the right value of the key.

Parameters
[in]seqThe curve the key belongs to.
[in]vThe right value to set.

◆ GetInterpolation()

CINTERPOLATION GetInterpolation ( void  ) const

Gets the interpolation type of the key.

Returns
The interpolation type: CINTERPOLATION

◆ SetInterpolation()

void SetInterpolation ( CCurve seq,
CINTERPOLATION  inter 
)

Sets the interpolation type of the key.

Parameters
[in]seqThe curve the key belongs to.
[in]interThe interpolation type to set: CINTERPOLATION

◆ GetQuatInterpolation()

ROTATIONINTERPOLATION_QUATERNION GetQuatInterpolation ( void  ) const

Gets the quaternion interpolation type of the key.

Since
R18
Returns
The interpolation type: ROTATIONINTERPOLATION_QUATERNION

◆ SetQuatInterpolation()

void SetQuatInterpolation ( CCurve seq,
ROTATIONINTERPOLATION_QUATERNION  inter,
Bool  bUndo = true 
)

Sets the quaternion interpolation type of the key.

Note
Keys at the same time on other component curve will be modified.
Since
R18
Parameters
[in]seqThe curve the key belongs to.
[in]interThe interpolation type to set: ROTATIONINTERPOLATION_QUATERNION
[in]bUndotrue to add the three rotation keys in the undo system, otherwise false.

◆ CopyDataTo()

Bool CopyDataTo ( CCurve destseq,
CKey dest,
AliasTrans trans 
) const

Copies the key data to dest.

Parameters
[in]destseqThe curve the destination key belongs to.
[in]destThe destination key.
[in]transAn alias translator for the operation. Can be nullptr. The caller owns the pointed object.
Returns
true if successful, otherwise false.

◆ GetClone()

CKey* GetClone ( AliasTrans trans) const

Gets a copy of the key.

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

◆ GetTrack()

CTrack* GetTrack ( void  )

Gets the track of the key.

Returns
The track.

◆ GetCurve()

CCurve* GetCurve ( void  )

Gets the curve of the key.

Returns
The curve.

◆ FlushData()

void FlushData ( void  )

Flushes the key: empties and resets data.

◆ GetAutomaticTangentMode()

CAUTOMODE GetAutomaticTangentMode ( void  ) const

Gets the AutoTangent mode of the key.

Since
R17.032
Returns
The AutoTangent mode: CAUTOMODE

◆ SetAutomaticTangentMode()

void SetAutomaticTangentMode ( CCurve seq,
CAUTOMODE  autoMode 
)

Sets the AutoTangent mode of the key.

Since
R17.032
Parameters
[in]seqThe curve the key belongs to.
[in]autoModeThe AutoTangent mode to set: CAUTOMODE

◆ SetTimeLeftAdjustValue()

Bool SetTimeLeftAdjustValue ( CCurve seq,
const BaseTime t 
)

Sets Time Left and adjusts Value so the angle stays the same.

Since
R17.032
Parameters
[in]seqThe curve the key belongs to.
[in]tThe new left time to set.
Returns
true if successful. false if current Time Left is smaller than FLT_MIN and Value is not Zero (angle cannot stay the same).

◆ SetTimeRightAdjustValue()

Bool SetTimeRightAdjustValue ( CCurve seq,
const BaseTime t 
)

Sets Time Right and adjusts Value so the angle stays the same.

Since
R17.032
Parameters
[in]seqThe curve the key belongs to.
[in]tThe new right time to set.
Returns
true if successful. false if current Time Right is smaller than FLT_MIN and Value is not Zero (angle cannot stay the same).

◆ GetKeyPreset()

CKEYPRESET GetKeyPreset ( void  ) const

Gets the preset mode of the key.

Since
R18.027
Returns
The preset mode: CKEYPRESET

◆ SetKeyPreset()

void SetKeyPreset ( CCurve seq,
CKEYPRESET  preset 
)

Sets the preset mode of the key.

Since
R18.027
Parameters
[in]seqThe curve the key belongs to.
[in]presetThe preset mode to set: CKEYPRESET