About
A CCurve represents an animation curve that stores and interpolates animation keys. A CCurve is stored in a CTrack object.
CCurve objects are an instance of CSbase
.
while (track != nullptr)
{
if (curve == nullptr)
continue;
for (
Int32 i = 0; i < keyCount; ++i)
{
if (key)
{
}
}
}
Access
CCurve objects cannot be created on their own. They are created with a CTrack that contains the CCurve object.
Keys
Access Keys
The CCurve objects stores the animation keys and provides access to these:
Add Keys
A CCurve object can create and receive keys:
const Int32 range = max - min;
const Int32 step = range / 10;
for (
Int32 i = 0; i <= 10; ++i)
{
if (curve->
AddKey(keyTime,
nullptr) ==
nullptr)
keyTime = keyTime + stepTime;
}
See also CKey Allocation/Deallocation.
Handle Keys
A CCurve object can be used to manipulate its keys:
Unmuted Keys
A key can be muted so it is ignored.
See also CKey Bits.
Animation
The interpolation between the keys defines the dynamics of an animation. This interpolation is refined with the tangents.
- CCurve::CalcHermite(): Calculates the Hermite spline between two sets of key values.
- CCurve::CalcSoftTangents(): Calculates the soft tangents (i.e. auto interpolation) around the key of the given index.
- CCurve::GetTangents(): Computes the tangents of a key, taking into account all options like zero slope, link slope etc.
- CCurve::GetValue(): Returns the value calculated at the given time, taking into account things like time curves.
for (
Int32 i = 0; i < 10; ++i)
{
time = time + step;
}
Time
A CCurve is confined by a first and a last key:
Further Reading
static String FloatToString(Float32 v, Int32 vvk=-1, Int32 nnk=-3)
Definition: c4d_string.h:529
BaseTime GetStartTime(void) const
Definition: c4d_canimation.h:569
void SetTime(CCurve *seq, const BaseTime &t)
Definition: c4d_canimation.h:96
Definition: c4d_basetime.h:24
MAXON_ATTRIBUTE_FORCE_INLINE auto end(COLLECTION &&c) -> decltype(c.End())
Definition: foreach.h:359
const CKey * FindNextUnmuted(Int32 idx, Int32 *ret_idx=nullptr) const
Definition: c4d_canimation.h:588
const CKey * GetKey(Int32 index) const
Definition: c4d_canimation.h:377
maxon::Float Float
Definition: ge_sys_math.h:66
Definition: c4d_canimation.h:354
Int32 GetFrame(Float fps) const
Definition: c4d_basetime.h:107
BaseTime GetEndTime(void) const
Definition: c4d_canimation.h:575
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:66
CKey * AddKey(const BaseTime &time, Int32 *nidx=nullptr, Bool bUndo=false, Bool SynchronizeKeys=false)
Definition: c4d_canimation.h:412
Definition: c4d_canimation.h:659
void SetLoopMaxTime(const BaseTime &t)
Bool FillKey(BaseDocument *doc, BaseList2D *bl, CKey *key)
Definition: c4d_canimation.h:810
Float Get(void) const
Definition: c4d_basetime.h:66
CTrack * GetNext() const
Definition: c4d_canimation.h:705
BaseTime GetTime(void) const
BaseTime GetMinTime(void)
void SetLoopMinTime(const BaseTime &t)
Float GetValue(const BaseTime &time) const
Definition: c4d_canimation.h:527
maxon::Int32 Int32
Definition: ge_sys_math.h:60
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:208
Definition: c4d_canimation.h:57
BaseTime GetTime(void) const
Definition: c4d_canimation.h:89
void SetKeyDefault(BaseDocument *doc, Int32 kidx)
CCurve * GetCurve(CCURVE type=CCURVE::CURVE, Bool bCreate=true)
Definition: c4d_canimation.h:824
const CKey * FindKey(const BaseTime &time, Int32 *idx=nullptr, FINDANIM match=FINDANIM::EXACT) const
Definition: c4d_canimation.h:393
CTrack * GetFirstCTrack()
BaseTime GetMaxTime(void)
Int32 GetKeyCount(void) const
Definition: c4d_canimation.h:370