CKey Class Reference

#include <c4d_ckey.h>

Inheritance diagram for CKey:

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)
 
virtual Int32 GetType () const
 
virtual Int32 GetDiskType () const
 
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 ()
 
virtual void Remove ()
 
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
 
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

CCurve * parentCurve
 
- 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

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

Private Attributes

BaseTime m_time
 
Float m_value
 
Float m_value_left
 
Float m_value_right
 
BaseTime m_time_left
 
BaseTime m_time_right
 
CINTERPOLATION m_inter
 
CAUTOMODE m_autoMode
 
ROTATIONINTERPOLATION m_quatInterp
 
GeData m_data
 

Friends

class CCurve
 
class CTrack
 
class GeTempDynArray< CKey >
 
Bool _ConvertOldToNewAnim (BaseDocument *doc, BaseList2D *op)
 

Alloc/Free

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

Get/Set Time

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

Get/Set Value

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

Interpolation

CINTERPOLATION GetInterpolation () const
 
void SetInterpolation (CCurve *seq, CINTERPOLATION inter)
 
ROTATIONINTERPOLATION GetQuatInterpolation () const
 
void SetQuatInterpolation (CCurve *seq, ROTATIONINTERPOLATION inter)
 

Copy/Clone

Bool CopyDataTo (CCurve *destseq, CKey *dest, AliasTrans *trans) const
 
virtual BaseList2D * GetClone (COPYFLAGS flags, AliasTrans *trn)
 

Miscellaneous

CTrack * GetTrack ()
 
CCurve * GetCurve ()
 
void FlushData ()
 
virtual Bool ChangeNBit (NBIT bit, NBITCONTROL bitmode)
 
Bool Identical (CKey *k2)
 

AutoTangent Mode

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

Tangent Helpers

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

Private

virtual Bool GetDParameter (const DescID &id, GeData &t_data)
 
virtual Bool SetDParameter (const DescID &id, const GeData &t_data)
 
virtual Bool CopyToX (PrivateChunk *dst, COPYFLAGS flags, AliasTrans *trans)
 
virtual Bool HandleSubChunk (HyperFile *hf, Int32 id, Int32 level)
 
virtual Bool Write (HyperFile *hf)
 
void SetKeyPreset (CCurve *seq, CKEYPRESET preset)
 
CKEYPRESET GetKeyPreset ()
 
void UnifyTangent ()
 
void SetQuatInterpolationI (CCurve *seq, ROTATIONINTERPOLATION inter, Bool synchronize=true)
 

Additional Inherited Members

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

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

Member Typedef Documentation

◆ SUPER

typedef BaseList2D SUPER

Constructor & Destructor Documentation

◆ CKey()

CKey ( )
private

◆ ~CKey()

~CKey ( )
private

Member Function Documentation

◆ IsInstanceOf()

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

Reimplemented from BaseList2D.

◆ Alloc()

static CKey* Alloc ( )
static

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

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

◆ Free()

static void Free ( CKey *&  key)
static

Destructs keys allocated with Alloc().

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

◆ GetTime()

BaseTime GetTime ( ) 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 ( ) 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 ( ) 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 ( ) 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;
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.
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 ( ) const

Gets the data of the key.

Returns
The data.

◆ SetGeData()

void SetGeData ( CCurve *  seq,
const GeData &  data 
)

Sets the data of the key.

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

◆ GetValueLeft()

Float GetValueLeft ( ) 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 ( ) 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 ( ) 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 GetQuatInterpolation ( ) const

Gets the quaternion interpolation type of the key.

Since
18.002
Returns
The interpolation type: ROTATIONINTERPOLATION

◆ SetQuatInterpolation()

void SetQuatInterpolation ( CCurve *  seq,
ROTATIONINTERPOLATION  inter 
)

Sets the quaternion interpolation type of the key.

Since
18.002 keys at the same time on other component curve will be modified
Parameters
[in]seqThe curve the key belongs to.
[in]interThe interpolation type to set: ROTATIONINTERPOLATION

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

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

Gets a copy of the key.

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

Reimplemented from BaseList2D.

◆ GetTrack()

CTrack* GetTrack ( )

Gets the track of the key.

Returns
The track.

◆ GetCurve()

CCurve* GetCurve ( )

Gets the curve of the key.

Returns
The curve.

◆ FlushData()

void FlushData ( )

Flushes the key: empties and resets data.

◆ ChangeNBit()

virtual Bool ChangeNBit ( NBIT  bit,
NBITCONTROL  bitmode 
)
virtual

Sets the key node bit.

Parameters
[in]bitThe node bit to set.
[in]bitmodeThe bit mode.
Returns
true if successful, otherwise false.

Reimplemented from GeListNode.

◆ Identical()

Bool Identical ( CKey *  k2)

Checks if the key is identical to k2.

Parameters
[in]k2The key to compare against. The caller owns the pointed key.
Returns
true if the keys are identical, otherwise false.

◆ GetAutomaticTangentMode()

CAUTOMODE GetAutomaticTangentMode ( ) const

Gets the AutoTangent mode of the key.

Since
17.008
Returns
The AutoTangent mode: CAUTOMODE

◆ SetAutomaticTangentMode()

void SetAutomaticTangentMode ( CCurve *  seq,
CAUTOMODE  autoMode 
)

Sets the AutoTangent mode of the key.

Since
17.008
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
17.008
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
17.008
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).

◆ GetDParameter()

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

Private.

Reimplemented from BaseList2D.

◆ SetDParameter()

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

Private.

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.

◆ SetKeyPreset()

void SetKeyPreset ( CCurve *  seq,
CKEYPRESET  preset 
)

Private.

◆ GetKeyPreset()

CKEYPRESET GetKeyPreset ( )

Private.

◆ UnifyTangent()

void UnifyTangent ( )

Private.

◆ SetQuatInterpolationI()

void SetQuatInterpolationI ( CCurve *  seq,
ROTATIONINTERPOLATION  inter,
Bool  synchronize = true 
)

Private.

◆ operator=()

const CKey& operator= ( const CKey &  key)
private

Friends And Related Function Documentation

◆ CCurve

friend class CCurve
friend

◆ CTrack

friend class CTrack
friend

◆ GeTempDynArray< CKey >

friend class GeTempDynArray< CKey >
friend

◆ _ConvertOldToNewAnim

Bool _ConvertOldToNewAnim ( BaseDocument *  doc,
BaseList2D *  op 
)
friend

Member Data Documentation

◆ parentCurve

CCurve* parentCurve
protected

◆ m_time

BaseTime m_time
private

◆ m_value

Float m_value
private

◆ m_value_left

Float m_value_left
private

◆ m_value_right

Float m_value_right
private

◆ m_time_left

BaseTime m_time_left
private

◆ m_time_right

BaseTime m_time_right
private

◆ m_inter

CINTERPOLATION m_inter
private

◆ m_autoMode

CAUTOMODE m_autoMode
private

◆ m_quatInterp

ROTATIONINTERPOLATION m_quatInterp
private

◆ m_data

GeData m_data
private
CK_PLA_DATA
@ CK_PLA_DATA
Definition: ckpla.h:8
CUSTOMDATATYPE_PLA
#define CUSTOMDATATYPE_PLA
PLA data type ID.
Definition: customdatatype_pla.h:22