This reference page is linked to from the following overview topics: Animation data structures, Animation classes and their interrelationships, List of Python FBX classes.
This is the interface for the FBX animation curve keys.
A key is defined by a time and a value. It also has tangents that control how the animation curve enters and exits the key.
Animation/main.cxx, ExportScene03/main.cxx, Pivot/main.cxx, and UserProperties/main.cxx.
Definition at line 372 of file kfbxanimcurve.h.
#include <kfbxanimcurve.h>
Public Member Functions |
|
KFbxAnimCurveKey () | |
Constructor with no argument. |
|
KFbxAnimCurveKey (KTime pTime) | |
Constructor with time. |
|
KFbxAnimCurveKey (KTime pTime, float pVal) | |
Constructor with time and value. |
|
KFbxAnimCurveKey (KFbxAnimCurveKey const &pFKey) | |
Copy constructor. |
|
~KFbxAnimCurveKey () | |
Destructor. |
|
KFbxAnimCurveKey & | operator= (const KFbxAnimCurveKey &pFKey) |
Assignment operator. |
|
KTime | GetTime () const |
Get time value. |
|
void | SetTime (const KTime &pTime) |
Set time value. |
|
void | Set (KTime pTime, float pValue) |
Set time and value of key. |
|
void | SetTCB (KTime pTime, float pValue, float pData0=0.0f, float pData1=0.0f, float pData2=0.0f) |
Set a key with cubic interpolation, TCB
tangent mode. |
|
float | GetValue () const |
Get the key value. |
|
void | SetValue (float pValue) |
Set the key value. |
|
KFbxAnimCurveDef::EInterpolationType | GetInterpolation () |
Get key's interpolation type. |
|
void | SetInterpolation (KFbxAnimCurveDef::EInterpolationType pInterpolation) |
Set key's interpolation type. |
|
KFbxAnimCurveDef::ETangentMode | GetTangentMode (bool pIncludeOverrides=false) |
Get key's tangent mode. |
|
void | SetTangentMode (KFbxAnimCurveDef::ETangentMode pTangentMode) |
Set tangent mode. |
|
KFbxAnimCurveDef::EWeightedMode | GetTangentWeightMode () const |
Get key's tangent weight mode. |
|
void | SetTangentWeightMode (KFbxAnimCurveDef::EWeightedMode pTangentWeightMode, KFbxAnimCurveDef::EWeightedMode pMask=KFbxAnimCurveDef::eWEIGHTED_ALL) |
Set key's tangent weight mode as double
value (cubic interpolation, non TCB tangent mode). |
|
KFbxAnimCurveDef::EVelocityMode | GetTangentVelocityMode () const |
Get key's tangent velocity mode. |
|
void | SetTangentVelocityMode (KFbxAnimCurveDef::EVelocityMode pTangentVelocityMode, KFbxAnimCurveDef::EVelocityMode pMask=KFbxAnimCurveDef::eVELOCITY_ALL) |
Set key's tangent velocity mode as double
value (cubic interpolation, non TCB tangent mode). |
|
KFbxAnimCurveDef::EConstantMode | GetConstantMode () const |
Get key constant mode. |
|
void | SetConstantMode (KFbxAnimCurveDef::EConstantMode pMode) |
Set key's constant mode. |
|
float | GetDataFloat (KFbxAnimCurveDef::EKFbxAnimCurveDataIndex pIndex) const |
Get the value of specified data of the key.
|
|
void | SetDataFloat (KFbxAnimCurveDef::EKFbxAnimCurveDataIndex pIndex, float pValue) |
Set the value of specified data of the key.
|
|
void | SetTangentVisibility (KFbxAnimCurveDef::ETangentVisibility pVisibility) |
Set tangent visibility mode. |
|
KFbxAnimCurveDef::ETangentVisibility | GetTangentVisibility () const |
Return tangent visibility mode. |
|
void | SetBreak (bool pVal) |
Turn on or turn off the tangent break.
|
|
bool | GetBreak () const |
Get if the tangent has a break. |
|
KFbxAnimCurveKeyImpl * | GetImpl () const |
Get key implementation. |
|
Static Public Member Functions |
|
static void | SetAllocatorFct (KFbxAnimCurveKeyImpl *(*pAllocatorFct)()) |
Set allocator function. |
|
static void | SetCopyAllocatorFct (KFbxAnimCurveKeyImpl *(*pCopyAllocatorFct)(KFbxAnimCurveKeyImpl *)) |
Set copy allocator function. |
|
static void | SetDeallocatorFct (void(*pDeallocatorFct)(KFbxAnimCurveKeyImpl *)) |
Set deallocator function. |
KFbxAnimCurveKey | ( | ) | [inline] |
Constructor with no argument.
Definition at line 379 of file kfbxanimcurve.h.
: KFbxAnimCurveKeyBase() { K_ASSERT(mAllocatorFct != NULL); mImpl = (*mAllocatorFct)(); }
KFbxAnimCurveKey | ( | KTime | pTime | ) | [inline] |
Constructor with time.
pTime | The time of key. |
Definition at line 388 of file kfbxanimcurve.h.
: KFbxAnimCurveKeyBase() { K_ASSERT(mAllocatorFct != NULL); mImpl = (*mAllocatorFct)(); SetTime(pTime); }
KFbxAnimCurveKey | ( | KTime | pTime, |
float | pVal | ||
) | [inline] |
Constructor with time and value.
pTime | The time of key. |
pVal | The value of key. |
Definition at line 399 of file kfbxanimcurve.h.
: KFbxAnimCurveKeyBase() { K_ASSERT(mAllocatorFct != NULL); mImpl = (*mAllocatorFct)(); Set(pTime, pVal); }
KFbxAnimCurveKey | ( | KFbxAnimCurveKey const & | pFKey | ) | [inline] |
Copy constructor.
Definition at line 408 of file kfbxanimcurve.h.
: KFbxAnimCurveKeyBase() { K_ASSERT(mCopyAllocatorFct != NULL); SetTime(pFKey.GetTime()); mImpl = mCopyAllocatorFct(pFKey.GetImpl()); }
~KFbxAnimCurveKey | ( | ) | [inline] |
Destructor.
Definition at line 417 of file kfbxanimcurve.h.
KFbxAnimCurveKey& operator= | ( | const KFbxAnimCurveKey & | pFKey | ) | [inline] |
KTime GetTime | ( | ) | const [inline, virtual] |
Get time value.
Reimplemented from KFbxAnimCurveKeyBase.
Definition at line 439 of file kfbxanimcurve.h.
{ return KFbxAnimCurveKeyBase::GetTime(); }
void SetTime | ( | const KTime & | pTime | ) | [inline, virtual] |
Set time value.
pTime | Time value to set. |
Reimplemented from KFbxAnimCurveKeyBase.
Definition at line 447 of file kfbxanimcurve.h.
{ KFbxAnimCurveKeyBase::SetTime(pTime); }
void Set | ( | KTime | pTime, |
float | pValue | ||
) | [inline] |
Set time and value of key.
pTime | New time of this key. |
pValue | New value of this key. |
Definition at line 456 of file kfbxanimcurve.h.
{ KFbxAnimCurveKeyBase::SetTime(pTime); mImpl->Set(pTime, pValue); }
void SetTCB | ( | KTime | pTime, |
float | pValue, | ||
float | pData0 = 0.0f , |
||
float | pData1 = 0.0f , |
||
float | pData2 =
0.0f |
||
) | [inline] |
Set a key with cubic interpolation, TCB tangent mode.
The key is modified according to the other parameters. The TCB mode controls the tension, continuity, and bias of the curve.
pTime | Key time. |
pValue | Key value. |
pData0 | Tension. Controls the amount of curvature in the animation curve. The higher the tension is, the more linear the curve looks. When the tension is low, the curve looks rounder or wider. |
pData1 | Continuity. Controls the smoothness or singularity of the curve on the key. |
pData2 | Bias. Controls if the effect of tension and continuity affect the curve before or after the key. |
Definition at line 473 of file kfbxanimcurve.h.
{ KFbxAnimCurveKeyBase::SetTime(pTime); mImpl->SetTCB(pTime, pValue, pData0, pData1, pData2); }
float GetValue | ( | ) | const [inline] |
Get the key value.
Definition at line 482 of file kfbxanimcurve.h.
{ return mImpl->GetValue(); }
void SetValue | ( | float | pValue | ) | [inline] |
Set the key value.
pValue | The value to set. |
Definition at line 490 of file kfbxanimcurve.h.
{ mImpl->SetValue(pValue); }
KFbxAnimCurveDef::EInterpolationType GetInterpolation | ( | ) | [inline] |
Get key's interpolation type.
Definition at line 498 of file kfbxanimcurve.h.
{ return mImpl->GetInterpolation(); }
void SetInterpolation | ( | KFbxAnimCurveDef::EInterpolationType | pInterpolation | ) | [inline] |
Set key's interpolation type.
pInterpolation | Interpolation type of the key. |
Definition at line 506 of file kfbxanimcurve.h.
{ mImpl->SetInterpolation(pInterpolation); }
KFbxAnimCurveDef::ETangentMode GetTangentMode | ( | bool | pIncludeOverrides =
false |
) | [inline] |
Get key's tangent mode.
pIncludeOverrides | Include override flags: Break, Clamp, Time-Independent. |
Definition at line 517 of file kfbxanimcurve.h.
{ return mImpl->GetTangentMode(pIncludeOverrides); }
void SetTangentMode | ( | KFbxAnimCurveDef::ETangentMode | pTangentMode | ) | [inline] |
Set tangent mode.
pTangentMode | Tangent mode to set. |
Definition at line 525 of file kfbxanimcurve.h.
{ mImpl->SetTangentMode(pTangentMode); }
KFbxAnimCurveDef::EWeightedMode GetTangentWeightMode | ( | ) | const [inline] |
Get key's tangent weight mode.
Definition at line 534 of file kfbxanimcurve.h.
{ return mImpl->GetTangentWeightMode(); }
void SetTangentWeightMode | ( | KFbxAnimCurveDef::EWeightedMode | pTangentWeightMode, |
KFbxAnimCurveDef::EWeightedMode | pMask =
KFbxAnimCurveDef::eWEIGHTED_ALL |
||
) | [inline] |
Set key's tangent weight mode as double value (cubic interpolation, non TCB tangent mode).
pTangentWeightMode | Weight mode. |
pMask | Used to select the affected tangents. |
Sample01:
KFbxAnimCurveKey* lAnimCurveKey = FbxSdkNew<KFbxAnimCurveKey>(); lAnimCurveKey->SetTangentWeightMode(KFbxAnimCurveDef::eWEIGHTED_NEXT_LEFT); lAnimCurveKey->SetTangentWeightMode(KFbxAnimCurveDef::eWEIGHTED_RIGHT, KFbxAnimCurveDef::eWEIGHTED_RIGHT);
pMask is eWEIGHTED_RIGHT, it will first be used to cancel out the current tangent weight mode eWEIGHTED_NEXT_LEFT, since they are not the same, it fails to cancel it out. Then the mask eWEIGHTED_RIGHT will be used to define which tangent should be affected, since it is the same as pTangentWeightMode (eWEIGHTED_RIGHT), so the eWEIGHTED_RIGHT should be affected. In total, after above calls, both eWEIGHTED_NEXT_LEFT and eWEIGHTED_RIGHT of this key are affected, so lAnimCurveKey->GetTangentWeightMode() will be KFbxAnimCurveDef::eWEIGHTED_ALL.
Sample02:
KFbxAnimCurveKey* lAnimCurveKey = FbxSdkNew<KFbxAnimCurveKey>(); lAnimCurveKey->SetTangentWeightMode(KFbxAnimCurveDef::eWEIGHTED_ALL); lAnimCurveKey->SetTangentWeightMode(KFbxAnimCurveDef::eWEIGHTED_RIGHT, KFbxAnimCurveDef::eWEIGHTED_NEXT_LEFT);
pMask is eWEIGHTED_NEXT_LEFT, it will first be used to cancel out the current tangent weight mode eWEIGHTED_ALL, it will cancel out affect on eWEIGHTED_NEXT_LEFT, but leave affect on eWEIGHTED_RIGHT. Then the mask eWEIGHTED_NEXT_LEFT will be used to define which tangent should be affected, since it is not the same as pTangentWeightMode (eWEIGHTED_RIGHT), so the pMask won't affect anything in this step. In total, after above calls, only eWEIGHTED_RIGHT of this key is still affected, so lAnimCurveKey->GetTangentWeightMode() will be KFbxAnimCurveDef::eWEIGHTED_RIGHT.
Definition at line 572 of file kfbxanimcurve.h.
{ mImpl->SetTangentWeightMode(pTangentWeightMode, pMask); }
KFbxAnimCurveDef::EVelocityMode GetTangentVelocityMode | ( | ) | const [inline] |
Get key's tangent velocity mode.
Definition at line 582 of file kfbxanimcurve.h.
{ return mImpl->GetTangentVelocityMode(); }
void SetTangentVelocityMode | ( | KFbxAnimCurveDef::EVelocityMode | pTangentVelocityMode, |
KFbxAnimCurveDef::EVelocityMode | pMask =
KFbxAnimCurveDef::eVELOCITY_ALL |
||
) | [inline] |
Set key's tangent velocity mode as double value (cubic interpolation, non TCB tangent mode).
pTangentVelocityMode | Velocity mode. |
pMask | Used to select the affected tangents |
Definition at line 596 of file kfbxanimcurve.h.
{ mImpl->SetTangentVelocityMode(pTangentVelocityMode, pMask); }
KFbxAnimCurveDef::EConstantMode GetConstantMode | ( | ) | const [inline] |
Get key constant mode.
Definition at line 606 of file kfbxanimcurve.h.
{ return mImpl->GetConstantMode(); }
void SetConstantMode | ( | KFbxAnimCurveDef::EConstantMode | pMode | ) | [inline] |
Set key's constant mode.
pMode | Constant mode to set. |
Definition at line 615 of file kfbxanimcurve.h.
{ mImpl->SetConstantMode(pMode); }
float GetDataFloat | ( | KFbxAnimCurveDef::EKFbxAnimCurveDataIndex | pIndex | ) | const [inline] |
Get the value of specified data of the key.
pIndex | Data index to specify which data to get value, the index is dependent on the key tangent mode. |
KFbxAnimCurveKey* lKey; // we suppose this is a valid pointer if(lKey->GetTangentMode() == KFbxAnimCurveDef::eTANGENT_TCB) { lKey->GetDataFloat(KFbxAnimCurveDef::eTCB_TENSION); lKey->GetDataFloat(KFbxAnimCurveDef::eTCB_CONTINUITY); lKey->GetDataFloat(KFbxAnimCurveDef::eTCB_BIAS); }
Definition at line 638 of file kfbxanimcurve.h.
{ return mImpl->GetDataFloat(pIndex); }
void SetDataFloat | ( | KFbxAnimCurveDef::EKFbxAnimCurveDataIndex | pIndex, |
float | pValue | ||
) | [inline] |
Set the value of specified data of the key.
pIndex | Data index to specify which data to get value, the index is dependent on the key tangent mode. |
pValue | The data value to set. |
KFbxAnimCurveKey* lKey; // we suppose this is a valid pointer lKey->SetInterpolation(KFbxAnimCurveDef::eINTERPOLATION_CUBIC); lKey->SetTangentMode(KFbxAnimCurveDef::eTANGENT_AUTO); lKey->SetDataFloat(KFbxAnimCurveDef::eRIGHT_SLOPE, 0.0);
Definition at line 658 of file kfbxanimcurve.h.
{ mImpl->SetDataFloat(pIndex, pValue); }
void SetTangentVisibility | ( | KFbxAnimCurveDef::ETangentVisibility | pVisibility | ) | [inline] |
Set tangent visibility mode.
This would indicate what part of the tangent is visible in a graphical interface.
pVisibility | Tangent visibility mode. |
Definition at line 667 of file kfbxanimcurve.h.
{ mImpl->SetTangentVisibility(pVisibility); }
KFbxAnimCurveDef::ETangentVisibility GetTangentVisibility | ( | ) | const [inline] |
Return tangent visibility mode.
Definition at line 676 of file kfbxanimcurve.h.
{ return mImpl->GetTangentVisibility(); }
void SetBreak | ( | bool | pVal | ) | [inline] |
Turn on or turn off the tangent break.
When this flag is on (KFbxAnimCurveDef::eTANGEAT_BREAK will be set), the key's left and right slopes are independent. When this flag is off, the key's left and right slope are equal.
pVal | Break flag (true or false ). |
Definition at line 687 of file kfbxanimcurve.h.
{ mImpl->SetBreak(pVal); }
bool GetBreak | ( | ) | const [inline] |
Get if the tangent has a break.
When this flag is set (KFbxAnimCurveDef::eTANGEAT_BREAK), the key's left and right slopes are independent. When this flag is off, the key's left and right slope are equal.
true
or false
).Definition at line 698 of file kfbxanimcurve.h.
{ return mImpl->GetBreak(); }
KFbxAnimCurveKeyImpl* GetImpl | ( | ) | const [inline] |
Get key implementation.
Definition at line 706 of file kfbxanimcurve.h.
{
return mImpl;
}
static void SetAllocatorFct | ( | KFbxAnimCurveKeyImpl *(*)() | pAllocatorFct | ) | [static] |
static void SetCopyAllocatorFct | ( | KFbxAnimCurveKeyImpl *(*)(KFbxAnimCurveKeyImpl *) | pCopyAllocatorFct | ) | [static] |
Set copy allocator function.
pCopyAllocatorFct | Copy allocator function |
static void SetDeallocatorFct | ( | void(*)(KFbxAnimCurveKeyImpl *) | pDeallocatorFct | ) | [static] |
Set deallocator function.
pDeallocatorFct | Deallocator function |