Public Member Functions | Static Public Member Functions

KFbxAnimCurveKey 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 KFbxAnimCurveKeyImpl as its implementation interface, for the time being, KFbxAnimCurveKeyImpl is implemented by KFbxAnimCurveKFCurveKey, and KFbxAnimCurveKFCurveKey encapsulates the legacy KFCurveKey structure for backward compatibility. However, this implementation is subject to change. Default constructor does not initialize data members. If an instance has to be initialized, use function KFbxAnimCurveKey::Set().
Examples:

Animation/main.cxx, ExportScene03/main.cxx, Pivot/main.cxx, and UserProperties/main.cxx.

Definition at line 372 of file kfbxanimcurve.h.

#include <kfbxanimcurve.h>

Inheritance diagram for KFbxAnimCurveKey:
Inheritance graph
[legend]

List of all members.

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.

Constructor & Destructor Documentation

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.

Parameters:
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.

Parameters:
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.

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

Member Function Documentation

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

Assignment operator.

Definition at line 425 of file kfbxanimcurve.h.

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

Get time value.

Returns:
Time value.

Reimplemented from KFbxAnimCurveKeyBase.

Examples:
ExportScene03/main.cxx.

Definition at line 439 of file kfbxanimcurve.h.

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

Set time value.

Parameters:
pTime Time value to set.

Reimplemented from KFbxAnimCurveKeyBase.

Definition at line 447 of file kfbxanimcurve.h.

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

Set time and value of key.

Parameters:
pTime New time of this key.
pValue New value of this key.
Examples:
Animation/main.cxx, ExportScene03/main.cxx, and Pivot/main.cxx.

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.

Parameters:
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.

Returns:
The value of the key.

Definition at line 482 of file kfbxanimcurve.h.

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

Set the key value.

Parameters:
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.

Returns:
Interpolation type of the queried key.

Definition at line 498 of file kfbxanimcurve.h.

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

Set key's interpolation type.

Parameters:
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.

Parameters:
pIncludeOverrides Include 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 517 of file kfbxanimcurve.h.

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

Set tangent mode.

Parameters:
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.

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

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).

Parameters:
pTangentWeightMode Weight mode.
pMask Used 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 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:

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.

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

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).

Parameters:
pTangentVelocityMode Velocity mode.
pMask Used 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 596 of file kfbxanimcurve.h.

    {
        mImpl->SetTangentVelocityMode(pTangentVelocityMode, pMask);
    }
KFbxAnimCurveDef::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 606 of file kfbxanimcurve.h.

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

Set key's constant mode.

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

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.

Parameters:
pIndex Data index to specify which data to get value, the index is dependent on the key tangent mode.
Returns:
The value of the specified data.
Remarks:
For the time being, KFbxAnimCurveDef::EKFbxAnimCurveDataIndex is defined according to the legacy KFCurveKey for backward compatibility. However, this is subject to change.
See also:
The documentation of KFbxAnimCurveKFCurveKey::GetDataFloat().

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.

Parameters:
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.
Remarks:
For the time being, KFbxAnimCurveDef::EKFbxAnimCurveDataIndex is defined according to the legacy KFCurveKey for backward compatibility. However, this is subject to change.
See also:
The documentation of KFbxAnimCurveKFCurveKey::SetDataFloat().

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.

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

Definition at line 667 of file kfbxanimcurve.h.

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

Return tangent visibility mode.

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

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.

Parameters:
pVal Break flag (true or false).
Remarks:
This method is meaningful for User (KFbxAnimCurveDef::eTANGENT_USER) and Auto (KFbxAnimCurveDef::eTANGENT_AUTO) tangent modes only.

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.

Returns:
Break flag (true or false).
Remarks:
This method is meaningful for User (KFbxAnimCurveDef::eTANGENT_USER) and Auto (KFbxAnimCurveDef::eTANGENT_AUTO) tangent modes only.

Definition at line 698 of file kfbxanimcurve.h.

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

Get key implementation.

Returns:
Pointer to implemented instance, e.g. a KFbxAnimCurveKFCurveKey.

Definition at line 706 of file kfbxanimcurve.h.

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

Set allocator function.

Parameters:
pAllocatorFct Allocator function
static void SetCopyAllocatorFct ( KFbxAnimCurveKeyImpl *(*)(KFbxAnimCurveKeyImpl *)  pCopyAllocatorFct ) [static]

Set copy allocator function.

Parameters:
pCopyAllocatorFct Copy allocator function
static void SetDeallocatorFct ( void(*)(KFbxAnimCurveKeyImpl *)  pDeallocatorFct ) [static]

Set deallocator function.

Parameters:
pDeallocatorFct Deallocator function

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

KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey
KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey KFbxAnimCurveKey