Public Member Functions | Static Public Member Functions

FbxAnimCurveKey Class Reference

This reference page is linked to from the following overview topics: Animation Data Structures, Animation Classes and their Interrelationships, List of Python Fbx classes.


Search for all occurrences

Detailed Description

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.

Remarks:
This class is now the main animation key object of the SDK, Users should always use this class to handle animation curve key. This class has a FbxAnimCurveKey_Impl as its implementation interface, Default constructor does not initialize data members. If an instance has to be initialized, use function FbxAnimCurveKey::Set().

Definition at line 348 of file fbxanimcurve.h.

#include <fbxanimcurve.h>

Inheritance diagram for FbxAnimCurveKey:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 FbxAnimCurveKey ()
 Constructor with no argument.
 FbxAnimCurveKey (FbxTime pTime)
 Constructor with time.
 FbxAnimCurveKey (FbxTime pTime, float pVal)
 Constructor with time and value.
 FbxAnimCurveKey (FbxAnimCurveKey const &pFKey)
 Copy constructor.
 ~FbxAnimCurveKey ()
 Destructor.
FbxAnimCurveKeyoperator= (const FbxAnimCurveKey &pFKey)
 Assignment operator.
FbxTime GetTime () const
 Get time value.
void SetTime (const FbxTime &pTime)
 Set time value.
void Set (FbxTime pTime, float pValue)
 Set time and value of key.
void SetTCB (FbxTime 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.
FbxAnimCurveDef::EInterpolationType GetInterpolation ()
 Get key's interpolation type.
void SetInterpolation (FbxAnimCurveDef::EInterpolationType pInterpolation)
 Set key's interpolation type.
FbxAnimCurveDef::ETangentMode GetTangentMode (bool pIncludeOverrides=false)
 Get key's tangent mode.
void SetTangentMode (FbxAnimCurveDef::ETangentMode pTangentMode)
 Set tangent mode.
FbxAnimCurveDef::EWeightedMode GetTangentWeightMode () const
 Get key's tangent weight mode.
void SetTangentWeightMode (FbxAnimCurveDef::EWeightedMode pTangentWeightMode, FbxAnimCurveDef::EWeightedMode pMask=FbxAnimCurveDef::eWeightedAll)
 Set key's tangent weight mode as double value (cubic interpolation, non TCB tangent mode).
void SetTangentWeightAndAdjustTangent (FbxAnimCurveDef::EDataIndex pIndex, double pWeight)
 Adjust the actual tangent of the key so that the tangent control point (tangent extremity) stays closer to where it should be.
FbxAnimCurveDef::EVelocityMode GetTangentVelocityMode () const
 Get key's tangent velocity mode.
void SetTangentVelocityMode (FbxAnimCurveDef::EVelocityMode pTangentVelocityMode, FbxAnimCurveDef::EVelocityMode pMask=FbxAnimCurveDef::eVelocityAll)
 Set key's tangent velocity mode as double value (cubic interpolation, non TCB tangent mode).
FbxAnimCurveDef::EConstantMode GetConstantMode () const
 Get key constant mode.
void SetConstantMode (FbxAnimCurveDef::EConstantMode pMode)
 Set key's constant mode.
float GetDataFloat (FbxAnimCurveDef::EDataIndex pIndex) const
 Get the value of specified data of the key.
void SetDataFloat (FbxAnimCurveDef::EDataIndex pIndex, float pValue)
 Set the value of specified data of the key.
void SetTangentVisibility (FbxAnimCurveDef::ETangentVisibility pVisibility)
 Set tangent visibility mode.
FbxAnimCurveDef::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.
FbxAnimCurveKey_ImplGetImpl () const
 Get key implementation.

Static Public Member Functions

static void SetAllocatorFct (FbxAnimCurveKey_Impl *(*pAllocatorFct)())
 Set allocator function.
static void SetCopyAllocatorFct (FbxAnimCurveKey_Impl *(*pCopyAllocatorFct)(FbxAnimCurveKey_Impl *))
 Set copy allocator function.
static void SetDeallocatorFct (void(*pDeallocatorFct)(FbxAnimCurveKey_Impl *))
 Set deallocator function.

Constructor & Destructor Documentation

FbxAnimCurveKey ( ) [inline]

Constructor with no argument.

Definition at line 353 of file fbxanimcurve.h.

                      : FbxAnimCurveKeyBase()
    {
        FBX_ASSERT(mAllocatorFct != NULL);
        mImpl = (*mAllocatorFct)();
    }
FbxAnimCurveKey ( FbxTime  pTime) [inline]

Constructor with time.

Parameters:
pTimeThe time of key.

Definition at line 362 of file fbxanimcurve.h.

                                   : FbxAnimCurveKeyBase()
    {
        FBX_ASSERT(mAllocatorFct != NULL);
        mImpl = (*mAllocatorFct)();
        SetTime(pTime);
    }
FbxAnimCurveKey ( FbxTime  pTime,
float  pVal 
) [inline]

Constructor with time and value.

Parameters:
pTimeThe time of key.
pValThe value of key.

Definition at line 373 of file fbxanimcurve.h.

                                               : FbxAnimCurveKeyBase()
    {
        FBX_ASSERT(mAllocatorFct != NULL);
        mImpl = (*mAllocatorFct)();
        Set(pTime, pVal);
    }
FbxAnimCurveKey ( FbxAnimCurveKey const &  pFKey) [inline]

Copy constructor.

Definition at line 382 of file fbxanimcurve.h.

                                                  : FbxAnimCurveKeyBase()
    {
        FBX_ASSERT(mCopyAllocatorFct != NULL);
        SetTime(pFKey.GetTime());
        mImpl = mCopyAllocatorFct(pFKey.GetImpl());
    }
~FbxAnimCurveKey ( ) [inline]

Destructor.

Definition at line 391 of file fbxanimcurve.h.

    {
        FBX_ASSERT(mDeallocatorFct != NULL);
        (*mDeallocatorFct)(mImpl);
    }

Member Function Documentation

FbxAnimCurveKey& operator= ( const FbxAnimCurveKey pFKey) [inline]

Assignment operator.

Definition at line 399 of file fbxanimcurve.h.

    {
        FBX_ASSERT(mImpl);
        if (mImpl)
        {
            *mImpl = *(pFKey.GetImpl());
        }
        SetTime(pFKey.GetTime());
        return *this;
    }
FbxTime GetTime ( ) const [inline, virtual]

Get time value.

Returns:
Time value.

Reimplemented from FbxAnimCurveKeyBase.

Definition at line 413 of file fbxanimcurve.h.

void SetTime ( const FbxTime pTime) [inline, virtual]

Set time value.

Parameters:
pTimeTime value to set.

Reimplemented from FbxAnimCurveKeyBase.

Definition at line 421 of file fbxanimcurve.h.

void Set ( FbxTime  pTime,
float  pValue 
) [inline]

Set time and value of key.

Parameters:
pTimeNew time of this key.
pValueNew value of this key.

Definition at line 430 of file fbxanimcurve.h.

    {
        FbxAnimCurveKeyBase::SetTime(pTime);
        mImpl->Set(pTime, pValue);
    }
void SetTCB ( FbxTime  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.

Parameters:
pTimeKey time.
pValueKey value.
pData0Tension. 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.
pData1Continuity. Controls the smoothness or singularity of the curve on the key.
pData2Bias. Controls if the effect of tension and continuity affect the curve before or after the key.

Definition at line 447 of file fbxanimcurve.h.

    {
        FbxAnimCurveKeyBase::SetTime(pTime);
        mImpl->SetTCB(pTime, pValue, pData0, pData1, pData2);
    }
float GetValue ( ) const [inline]

Get the key value.

Returns:
The value of the key.

Definition at line 456 of file fbxanimcurve.h.

    {
        return mImpl->GetValue();
    }
void SetValue ( float  pValue) [inline]

Set the key value.

Parameters:
pValueThe value to set.

Definition at line 464 of file fbxanimcurve.h.

    {
        mImpl->SetValue(pValue);
    }
FbxAnimCurveDef::EInterpolationType GetInterpolation ( ) [inline]

Get key's interpolation type.

Returns:
Interpolation type of the queried key.

Definition at line 473 of file fbxanimcurve.h.

    {
        return mImpl->GetInterpolation();
    }
void SetInterpolation ( FbxAnimCurveDef::EInterpolationType  pInterpolation) [inline]

Set key's interpolation type.

Parameters:
pInterpolationInterpolation type of the key.

Definition at line 481 of file fbxanimcurve.h.

    {
        mImpl->SetInterpolation(pInterpolation);
    }
FbxAnimCurveDef::ETangentMode GetTangentMode ( bool  pIncludeOverrides = false) [inline]

Get key's tangent mode.

Parameters:
pIncludeOverridesInclude override flags: Break, Clamp, Time-Independent.
Returns:
Tangent mode of the key.
Remarks:
This method is meaningful for cubic interpolation only. Using this method for non cubic interpolated key will return unpredictable value.

Definition at line 492 of file fbxanimcurve.h.

    {
        return mImpl->GetTangentMode(pIncludeOverrides);
    }
void SetTangentMode ( FbxAnimCurveDef::ETangentMode  pTangentMode) [inline]

Set tangent mode.

Parameters:
pTangentModeTangent mode to set.

Definition at line 500 of file fbxanimcurve.h.

    {
        mImpl->SetTangentMode(pTangentMode);
    }
FbxAnimCurveDef::EWeightedMode GetTangentWeightMode ( ) const [inline]

Get key's tangent weight mode.

Returns:
Tangent weight mode of the key.
Remarks:
This method is meaningful for cubic interpolation only.

Definition at line 509 of file fbxanimcurve.h.

    {
        return mImpl->GetTangentWeightMode();
    }
void SetTangentWeightMode ( FbxAnimCurveDef::EWeightedMode  pTangentWeightMode,
FbxAnimCurveDef::EWeightedMode  pMask = FbxAnimCurveDef::eWeightedAll 
) [inline]

Set key's tangent weight mode as double value (cubic interpolation, non TCB tangent mode).

Parameters:
pTangentWeightModeWeight mode.
pMaskUsed to select the affected tangents.
Remarks:
This method is meaningful for cubic interpolation only. The pMask will be used to cancel out the current tangent weight mode first, and then be used to define which tangent to select to affect.

Sample01:

pMask is eWeightedRight, it will first be used to cancel out the current tangent weight mode eWeightedNextLeft, since they are not the same, it fails to cancel it out. Then the mask eWeightedRight will be used to define which tangent should be affected, since it is the same as pTangentWeightMode (eWeightedRight), so the eWeightedRight should be affected. In total, after above calls, both eWeightedNextLeft and eWeightedRight of this key are affected, so lAnimCurveKey->GetTangentWeightMode() will be FbxAnimCurveDef::eWeightedAll.

Sample02:

pMask is eWeightedNextLeft, it will first be used to cancel out the current tangent weight mode eWeightedAll, it will cancel out affect on eWeightedNextLeft, but leave affect on eWeightedRight. Then the mask eWeightedNextLeft will be used to define which tangent should be affected, since it is not the same as pTangentWeightMode (eWeightedRight), so the pMask won't affect anything in this step. In total, after above calls, only eWeightedRight of this key is still affected, so lAnimCurveKey->GetTangentWeightMode() will be FbxAnimCurveDef::eWeightedRight.

Definition at line 547 of file fbxanimcurve.h.

    {
        mImpl->SetTangentWeightMode(pTangentWeightMode, pMask);
    }
void SetTangentWeightAndAdjustTangent ( FbxAnimCurveDef::EDataIndex  pIndex,
double  pWeight 
) [inline]

Adjust the actual tangent of the key so that the tangent control point (tangent extremity) stays closer to where it should be.

This is required because the weight value gets imprecise when it is small (it is stored as a fixed point value). This method must be called when setting the weight coming from a source where the precision is the same. It must be called after the tangent value has been set.

Remarks:
Do not use this call repetitively (from an interactive editor for example) because this function will create imprecision on the tangent value.
Parameters:
pIndexFbxAnimCurveDef::EDataIndex
pWeightNew tangent weight value.

Definition at line 562 of file fbxanimcurve.h.

    {
        mImpl->SetTangentWeightAndAdjustTangent(pIndex, pWeight);
    }
FbxAnimCurveDef::EVelocityMode GetTangentVelocityMode ( ) const [inline]

Get key's tangent velocity mode.

Returns:
Tangent velocity mode of the key.
Remarks:
This method is meaningful for cubic interpolation only.

Definition at line 571 of file fbxanimcurve.h.

    {
        return mImpl->GetTangentVelocityMode();
    }
void SetTangentVelocityMode ( FbxAnimCurveDef::EVelocityMode  pTangentVelocityMode,
FbxAnimCurveDef::EVelocityMode  pMask = FbxAnimCurveDef::eVelocityAll 
) [inline]

Set key's tangent velocity mode as double value (cubic interpolation, non TCB tangent mode).

Parameters:
pTangentVelocityModeVelocity mode.
pMaskUsed to select the affected tangents
Remarks:
This method is meaningful for cubic interpolation only. The pMask will be used to cancel out the current tangent velocity mode first, and then be used to define which tangent to select to affect.
See also:
The documentation of SetTangentWeightMode for more details and samples about how the pMask works.

Definition at line 585 of file fbxanimcurve.h.

    {
        mImpl->SetTangentVelocityMode(pTangentVelocityMode, pMask);
    }
FbxAnimCurveDef::EConstantMode GetConstantMode ( ) const [inline]

Get key constant mode.

Returns:
Key constant mode.
Remarks:
This method is meaningful for constant interpolation only. Using this method for non constant interpolated key will return unpredicted value.

Definition at line 595 of file fbxanimcurve.h.

    {
        return mImpl->GetConstantMode();
    }
void SetConstantMode ( FbxAnimCurveDef::EConstantMode  pMode) [inline]

Set key's constant mode.

Parameters:
pModeConstant mode to set.
Remarks:
This method is meaningful for constant interpolation only.

Definition at line 604 of file fbxanimcurve.h.

    {
        mImpl->SetConstantMode(pMode);
    }
float GetDataFloat ( FbxAnimCurveDef::EDataIndex  pIndex) const [inline]

Get the value of specified data of the key.

Parameters:
pIndexData index to specify which data to get value, the index is dependent on the key tangent mode.
Returns:
The value of the specified data.

Definition at line 623 of file fbxanimcurve.h.

    {
        return mImpl->GetDataFloat(pIndex);
    }
void SetDataFloat ( FbxAnimCurveDef::EDataIndex  pIndex,
float  pValue 
) [inline]

Set the value of specified data of the key.

Parameters:
pIndexData index to specify which data to get value, the index is dependent on the key tangent mode.
pValueThe data value to set.

Definition at line 639 of file fbxanimcurve.h.

    {
        mImpl->SetDataFloat(pIndex, pValue);
    }
void SetTangentVisibility ( FbxAnimCurveDef::ETangentVisibility  pVisibility) [inline]

Set tangent visibility mode.

This would indicate what part of the tangent is visible in a graphical interface.

Parameters:
pVisibilityTangent visibility mode.
Remarks:
This method is meaningful for cubic interpolation only.

Definition at line 648 of file fbxanimcurve.h.

    {
        mImpl->SetTangentVisibility(pVisibility);
    }
FbxAnimCurveDef::ETangentVisibility GetTangentVisibility ( ) const [inline]

Return tangent visibility mode.

Returns:
Tangent visibility mode.
Remarks:
This method is meaningful for cubic interpolation only.

Definition at line 657 of file fbxanimcurve.h.

    {
        return mImpl->GetTangentVisibility();
    }
void SetBreak ( bool  pVal) [inline]

Turn on or turn off the tangent break.

When this flag is on (FbxAnimCurveDef::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.

Parameters:
pValBreak flag (true or false).
Remarks:
This method is meaningful for User (FbxAnimCurveDef::eTangentUser) and Auto (FbxAnimCurveDef::eTangentAuto) tangent modes only.

Definition at line 668 of file fbxanimcurve.h.

    {
        mImpl->SetBreak(pVal);
    }
bool GetBreak ( ) const [inline]

Get if the tangent has a break.

When this flag is set (FbxAnimCurveDef::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.

Returns:
Break flag (true or false).
Remarks:
This method is meaningful for User (FbxAnimCurveDef::eTangentUser) and Auto (FbxAnimCurveDef::eTangentAuto) tangent modes only.

Definition at line 679 of file fbxanimcurve.h.

    {
        return mImpl->GetBreak();
    }
FbxAnimCurveKey_Impl* GetImpl ( ) const [inline]

Get key implementation.

Returns:
Pointer to implemented instance.

Definition at line 687 of file fbxanimcurve.h.

    {
        return mImpl;
    }
static void SetAllocatorFct ( FbxAnimCurveKey_Impl *(*)()  pAllocatorFct) [static]

Set allocator function.

Parameters:
pAllocatorFctAllocator function
static void SetCopyAllocatorFct ( FbxAnimCurveKey_Impl *(*)(FbxAnimCurveKey_Impl *)  pCopyAllocatorFct) [static]

Set copy allocator function.

Parameters:
pCopyAllocatorFctCopy allocator function
static void SetDeallocatorFct ( void(*)(FbxAnimCurveKey_Impl *)  pDeallocatorFct) [static]

Set deallocator function.

Parameters:
pDeallocatorFctDeallocator function

The documentation for this class was generated from the following file:

FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey
FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey FbxAnimCurveKey