#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 (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 |
Miscellaneous | |
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) |
|
private |
|
private |
|
static |
|
static |
BaseTime GetTime | ( | void | ) | 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 | ( | void | ) | 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 | ( | void | ) | 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 | ( | void | ) | 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 | ( | void | ) | 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 | ( | void | ) | 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 | ( | void | ) | 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 | ( | void | ) | 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 | ( | void | ) | 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 | ( | void | ) |
Gets the track of the key.
CCurve* GetCurve | ( | void | ) |
Gets the curve of the key.
void FlushData | ( | void | ) |
Flushes the key: empties and resets data.
CAUTOMODE GetAutomaticTangentMode | ( | void | ) | 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 | ( | void | ) | 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 |