#include <c4d_canimation.h>
Represents a key in the CCurve of a track which represent the animation of a parameter.
Tangents are only guaranteed to be available for tracks of category CTRACK_CATEGORY_VALUE. Tracks of the categories CTRACK_CATEGORY_DATA and CTRACK_CATEGORY_PLUGIN may contain tangent data or not. E.g., a BaseTime track will provide tangents for its keys, while a PLA track will not. Such tracks which do not provide tangent data will however not raise an error on attempting to retrieve a tangent for a key, but instead return the null-vector (0, 0, 0)
.
Private Member Functions | |
CKey () | |
~CKey () | |
const CKey & | operator= (const CKey &key) |
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 &d) |
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_QUATERNION | GetQuatInterpolation () 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 |
Miscellaneous | |
CTrack * | GetTrack () |
CCurve * | GetCurve () |
void | FlushData () |
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) |
Key Preset Mode | |
CKEYPRESET | GetKeyPreset () const |
void | SetKeyPreset (CCurve *seq, CKEYPRESET preset) |
|
private |
|
private |
|
static |
|
static |
BaseTime GetTime | ( | ) | const |
Gets the time of the key.
Sets the time of the key.
[in] | seq | The curve the key belongs to. |
[in] | t | The time to set. |
BaseTime GetTimeLeft | ( | ) | const |
Gets the time component of the left tangent of the key.
See class description for details on the availability of tangents. Note that this function does not take key presets, e.g., CKEYPRESET::AUTO_CLAMP, into account, but always returns the underlying true tangent data, as if the preset was CKEYPRESET::CUSTOM. Use CCurve::GetTangents to retrieve tangents respecting the key preset settings.
Gets the time component of the left tangent of the key.
See class description for details on the availability of tangents.
[in] | seq | The curve the key belongs to. |
[in] | t | The time component of the left tangent to set. |
BaseTime GetTimeRight | ( | ) | const |
Gets the time component of the right tangent of the key.
See class description for details on the availability of tangents. Note that this function does not take key presets, e.g., CKEYPRESET::AUTO_CLAMP, into account, but always returns the underlying true tangent data, as if the preset was CKEYPRESET::CUSTOM. Use CCurve::GetTangents to retrieve tangents respecting the key preset settings.
Gets the time component of the right tangent of the key.
See class description for details on the availability of tangents.
[in] | seq | The curve the key belongs to. |
[in] | t | The time component of the right tangent to set. |
Float GetValue | ( | ) | const |
Gets the value of the key.
Used to read keys of tracks that are of category CTRACK_CATEGORY_VALUE. This usually only does apply to DTYPE_REAL and DTYPE_LONG tracks, other data types must be read with CKey.GetGeData. An exception to that rule are tracks for data types that are composed out of float
values, like for example Vector or Matrix. Here the type is being decomposed into multiple tracks of floating point values. E.g., for a vector into its three or four components and for a matrix first into its vectors and then each vector into its components. Call CTrack::GetTrackCategory to determine the category of a track and therefore the method which has to be used to read data from its keys. Example: Reading of PLA keys.
ptag
/htag
contain the point/tangent information.
Sets the value of the key.
Used to write keys of tracks that are of category CTRACK_CATEGORY_VALUE. This usually only does apply to DTYPE_REAL and DTYPE_LONG tracks, other data types must be read with CKey.GetGeData. An exception to that rule are tracks for data types that are composed out of float
values, like for example Vector or Matrix. Here the type is being decomposed into multiple tracks of floating point values. E.g., for a vector into its three or four components and for a matrix first into its vectors and then each vector into its components. Call CTrack::GetTrackCategory to determine the category of a track and therefore the method which has to be used to read data from its keys.
[in] | seq | The curve the key belongs to. |
[in] | v | The value to set. |
const GeData& GetGeData | ( | ) | const |
Gets the data of the key.
Used to read keys of tracks that are of category CTRACK_CATEGORY_DATA. This usually does apply to tracks that neither store DTYPE_REAL and DTYPE_LONG data, and those data types must be written with CKey::GetValue. An exception to that rule are tracks for data types that are composed out of float
values, like for example Vector or Matrix. Here the type is being decomposed into multiple tracks of floating point values. E.g., for a vector into its three or four components and for a matrix first into its vectors and then each vector into its components. Call CTrack::GetTrackCategory to determine the category of a track and therefore the method which has to be used to write data into its keys.
Sets the data of the key.
Used to write keys of tracks that are of category CTRACK_CATEGORY_DATA. This usually does apply to tracks that neither store DTYPE_REAL and DTYPE_LONG data, and those data types must be written with CKey::SetValue. An exception to that rule are tracks for data types that are composed out of float
values, like for example Vector or Matrix. Here the type is being decomposed into multiple tracks of floating point values. E.g., for a vector into its three or four components and for a matrix first into its vectors and then each vector into its components. Call CTrack::GetTrackCategory to determine the category of a track and therefore the method which has to be used to write data into its keys.
[in] | seq | The curve the key belongs to. |
[in] | d | The new key data. |
Float GetValueLeft | ( | ) | const |
Gets the value component of the left tangent of the key.
See class description for details on the availability of tangents. Note that this function does not take key presets, e.g., CKEYPRESET::AUTO_CLAMP, into account, but always returns the underlying true tangent data, as if the preset was CKEYPRESET::CUSTOM. Use CCurve::GetTangents to retrieve tangents respecting the key preset settings.
Sets the value component of the left tangent of the key.
See class description for details on the availability of tangents.
[in] | seq | The curve the key belongs to. |
[in] | v | The value component of the left tangent to set. |
Float GetValueRight | ( | ) | const |
Gets the value component of the right tangent of the key.
See class description for details on the availability of tangents. Note that this function does not take key presets, e.g., CKEYPRESET::AUTO_CLAMP, into account, but always returns the underlying true tangent data, as if the preset was CKEYPRESET::CUSTOM. Use CCurve::GetTangents to retrieve tangents respecting the key preset settings.
Sets the value component of the right tangent of the key.
See class description for details on the availability of tangents.
[in] | seq | The curve the key belongs to. |
[in] | v | The value component of the right tangent to set. |
CINTERPOLATION GetInterpolation | ( | ) | const |
Gets the interpolation type of the key.
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 |
ROTATIONINTERPOLATION_QUATERNION GetQuatInterpolation | ( | ) | const |
Gets the quaternion interpolation type of the key.
void SetQuatInterpolation | ( | CCurve * | seq, |
ROTATIONINTERPOLATION_QUATERNION | inter, | ||
Bool | bUndo = true |
||
) |
Sets the quaternion interpolation type of the key.
[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. |
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. |
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. |
CTrack* GetTrack | ( | ) |
Gets the track of the key.
CCurve* GetCurve | ( | ) |
Gets the curve of the key.
void FlushData | ( | ) |
Flushes the key: empties and resets data.
CAUTOMODE GetAutomaticTangentMode | ( | ) | const |
Sets the AutoTangent mode of the key.
[in] | seq | The curve the key belongs to. |
[in] | autoMode | The AutoTangent mode to set: CAUTOMODE |
Sets Time Left and adjusts Value so the angle stays the same.
[in] | seq | The curve the key belongs to. |
[in] | t | The new left time to set. |
FLT_MIN
and Value is not Zero (angle cannot stay the same). Sets Time Right and adjusts Value so the angle stays the same.
[in] | seq | The curve the key belongs to. |
[in] | t | The new right time to set. |
FLT_MIN
and Value is not Zero (angle cannot stay the same). CKEYPRESET GetKeyPreset | ( | ) | const |
void SetKeyPreset | ( | CCurve * | seq, |
CKEYPRESET | preset | ||
) |
Sets the preset mode of the key.
[in] | seq | The curve the key belongs to. |
[in] | preset | The preset mode to set: CKEYPRESET |