CKey Class Reference

#include <c4d_canimation.h>

Inheritance diagram for CKey:

详细描述

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

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

私有成员函数

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

Alloc/Free

static CKey Alloc ()
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 GeData GetGeData (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
CKey GetClone ( AliasTrans *trans) const

杂项

CTrack GetTrack (void)
CCurve GetCurve (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
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)

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

◆  CKey()

CKey () private

◆  ~CKey()

~ CKey ( void  )
private

成员函数文档编制

◆  operator=()

const CKey & operator= ( const CKey key )
private

◆  Alloc()

static CKey * Alloc ( )
static

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

返回
The allocated key, or nullptr if the allocation failed.

◆  Free()

static void Free ( CKey *&  key )
static

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

参数
[in,out] key The 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.

返回
The time.

◆  SetTime()

void SetTime ( CCurve seq ,
const BaseTime t  
)

Sets the time of the key.

参数
[in] seq The curve the key belongs to.
[in] t The time to set.

◆  GetTimeLeft()

BaseTime GetTimeLeft ( void  ) const

Gets the left time of the key.

返回
The left time.

◆  SetTimeLeft()

void SetTimeLeft ( CCurve seq ,
const BaseTime t  
)

Sets the left time of the key.

参数
[in] seq The curve the key belongs to.
[in] t The left time to set.

◆  GetTimeRight()

BaseTime GetTimeRight ( void  ) const

Gets the right time of the key.

返回
The right time.

◆  SetTimeRight()

void SetTimeRight ( CCurve seq ,
const BaseTime t  
)

Sets the right time of the key.

参数
[in] seq The curve the key belongs to.
[in] t The right time to set.

◆  GetValue()

Float GetValue ( void  ) const

Gets the value of the key.

注意
使用 GetParameter() to read non-real values.
范例: Reading of PLA keys. GeData data; if (!key->GetParameter( DescLevel ( CK_PLA_DATA , CUSTOMDATATYPE_PLA ,0), data, 0)) return false ; PLAData * pla = ( PLAData *)data. GetCustomDataType ( CUSTOMDATATYPE_PLA ); if (pla== nullptr ) return false ; VariableTag *ptag = nullptr , *htag = nullptr ; pla-> GetVariableTags (ptag, htag); ptag / htag contain the point/tangent information.
返回
The value.

◆  SetValue()

void SetValue ( CCurve seq ,
Float   v  
)

Sets the value of the key.

参数
[in] seq The curve the key belongs to.
[in] v The value to set.

◆  GetGeData()

const GeData & GetGeData ( void  ) const

Gets the data of the key.

返回
The data.

◆  SetGeData()

void SetGeData ( CCurve seq ,
const GeData d  
)

Sets the data of the key.

参数
[in] seq The curve the key belongs to.
[in] d The new key data.

◆  GetValueLeft()

Float GetValueLeft ( void  ) const

Gets the left value of the key.

返回
The left value.

◆  SetValueLeft()

void SetValueLeft ( CCurve seq ,
Float   v  
)

Sets the left value of the key.

参数
[in] seq The curve the key belongs to.
[in] v The left value to set.

◆  GetValueRight()

Float GetValueRight ( void  ) const

Gets the right value of the key.

返回
The right value.

◆  SetValueRight()

void SetValueRight ( CCurve seq ,
Float   v  
)

Sets the right value of the key.

参数
[in] seq The curve the key belongs to.
[in] v The right value to set.

◆  GetInterpolation()

CINTERPOLATION GetInterpolation ( void  ) const

Gets the interpolation type of the key.

返回
The interpolation type: CINTERPOLATION

◆  SetInterpolation()

void SetInterpolation ( CCurve seq ,
CINTERPOLATION   inter  
)

Sets the interpolation type of the key.

参数
[in] seq The curve the key belongs to.
[in] inter The interpolation type to set: CINTERPOLATION

◆  GetQuatInterpolation()

ROTATIONINTERPOLATION_QUATERNION GetQuatInterpolation ( void  ) const

Gets the quaternion interpolation type of the key.

由于
R18
返回
The interpolation type: ROTATIONINTERPOLATION_QUATERNION

◆  SetQuatInterpolation()

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

Sets the quaternion interpolation type of the key.

注意
Keys at the same time on other component curve will be modified.
由于
R18
参数
[in] seq The curve the key belongs to.
[in] inter The interpolation type to set: ROTATIONINTERPOLATION_QUATERNION
[in] bUndo true 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 .

参数
[in] destseq The curve the destination key belongs to.
[in] dest The destination key.
[in] trans An alias translator for the operation. Can be nullptr . The caller owns the pointed object.
返回
true if successful, otherwise false .

◆  GetClone()

CKey * GetClone ( AliasTrans trans ) const

Gets a copy of the key.

参数
[in] trans An alias translator for the operation. Can be nullptr . The caller owns the pointed alias translator.
返回
The cloned key. The caller owns the pointed key.

◆  GetTrack()

CTrack * GetTrack ( void  )

Gets the track of the key.

返回
The track.

◆  GetCurve()

CCurve * GetCurve ( void  )

Gets the curve of the key.

返回
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.

由于
R17.032
返回
The AutoTangent mode: CAUTOMODE

◆  SetAutomaticTangentMode()

void SetAutomaticTangentMode ( CCurve seq ,
CAUTOMODE   autoMode  
)

Sets the AutoTangent mode of the key.

由于
R17.032
参数
[in] seq The curve the key belongs to.
[in] autoMode The 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.

由于
R17.032
参数
[in] seq The curve the key belongs to.
[in] t The new left time to set.
返回
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.

由于
R17.032
参数
[in] seq The curve the key belongs to.
[in] t The new right time to set.
返回
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.

由于
R18.027
返回
The preset mode: CKEYPRESET

◆  SetKeyPreset()

void SetKeyPreset ( CCurve seq ,
CKEYPRESET   preset  
)

Sets the preset mode of the key.

由于
R18.027
参数
[in] seq The curve the key belongs to.
[in] preset The preset mode to set: CKEYPRESET
CK_PLA_DATA
@ CK_PLA_DATA
定义: ckpla.h:8
CUSTOMDATATYPE_PLA
#define CUSTOMDATATYPE_PLA
PLA custom data type ID.
定义: customgui_pla.h:26
VariableTag
定义: c4d_basetag.h:116
PLAData
PLA custom data type (CUSTOMDATATYPE_PLA) for PLA tracks.
定义: customgui_pla.h:34
DescLevel
Represents a level within a DescID.
定义: lib_description.h:286
GeData
定义: c4d_gedata.h:82
GeData::GetCustomDataType
CustomDataType * GetCustomDataType(Int32 datatype) const
定义: c4d_gedata.h:507
PLAData::GetVariableTags
void GetVariableTags(PointTag *&ptag, TangentTag *&htag)