FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FbxAnimCurveKey Class Reference

#include <fbxanimcurve.h>

Class 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().
Examples:
Animation/main.cxx, Audio/main.cxx, ExportScene03/main.cxx, Pivot/main.cxx, and UserProperties/main.cxx.

Definition at line 348 of file fbxanimcurve.h.

+ Inheritance diagram for FbxAnimCurveKey:

Public Member Functions

 FbxAnimCurveKey ()
 Constructor with no argument. More...
 
 FbxAnimCurveKey (FbxTime pTime)
 Constructor with time. More...
 
 FbxAnimCurveKey (FbxTime pTime, float pVal)
 Constructor with time and value. More...
 
 FbxAnimCurveKey (FbxAnimCurveKey const &pFKey)
 Copy constructor. More...
 
 ~FbxAnimCurveKey ()
 Destructor. More...
 
FbxAnimCurveKeyoperator= (const FbxAnimCurveKey &pFKey)
 Assignment operator. More...
 
FbxTime GetTime () const
 Get time value. More...
 
void SetTime (const FbxTime &pTime)
 Set time value. More...
 
void Set (FbxTime pTime, float pValue)
 Set time and value of key. More...
 
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. More...
 
float GetValue () const
 Get the key value. More...
 
void SetValue (float pValue)
 Set the key value. More...
 
FbxAnimCurveDef::EInterpolationType GetInterpolation ()
 Get key's interpolation type. More...
 
void SetInterpolation (FbxAnimCurveDef::EInterpolationType pInterpolation)
 Set key's interpolation type. More...
 
FbxAnimCurveDef::ETangentMode GetTangentMode (bool pIncludeOverrides=false)
 Get key's tangent mode. More...
 
void SetTangentMode (FbxAnimCurveDef::ETangentMode pTangentMode)
 Set tangent mode. More...
 
FbxAnimCurveDef::EWeightedMode GetTangentWeightMode () const
 Get key's tangent weight mode. More...
 
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). More...
 
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. More...
 
FbxAnimCurveDef::EVelocityMode GetTangentVelocityMode () const
 Get key's tangent velocity mode. More...
 
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). More...
 
FbxAnimCurveDef::EConstantMode GetConstantMode () const
 Get key constant mode. More...
 
void SetConstantMode (FbxAnimCurveDef::EConstantMode pMode)
 Set key's constant mode. More...
 
float GetDataFloat (FbxAnimCurveDef::EDataIndex pIndex) const
 Get the value of specified data of the key. More...
 
void SetDataFloat (FbxAnimCurveDef::EDataIndex pIndex, float pValue)
 Set the value of specified data of the key. More...
 
void SetTangentVisibility (FbxAnimCurveDef::ETangentVisibility pVisibility)
 Set tangent visibility mode. More...
 
FbxAnimCurveDef::ETangentVisibility GetTangentVisibility () const
 Return tangent visibility mode. More...
 
void SetBreak (bool pVal)
 Turn on or turn off the tangent break. More...
 
bool GetBreak () const
 Get if the tangent has a break. More...
 
FbxAnimCurveKey_ImplGetImpl () const
 Get key implementation. More...
 
- Public Member Functions inherited from FbxAnimCurveKeyBase
 FbxAnimCurveKeyBase ()
 Constructor. More...
 
virtual ~FbxAnimCurveKeyBase ()
 Destructor. More...
 

Static Public Member Functions

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

Additional Inherited Members

- Public Attributes inherited from FbxAnimCurveKeyBase
FbxTime mTime
 Data member representing time value. More...
 

Constructor & Destructor Documentation

◆ FbxAnimCurveKey() [1/4]

FbxAnimCurveKey ( )
inline

Constructor with no argument.

Definition at line 353 of file fbxanimcurve.h.

354  {
355  FBX_ASSERT(mAllocatorFct != NULL);
356  mImpl = (*mAllocatorFct)();
357  }
#define NULL
Definition: fbxarch.h:210
FbxAnimCurveKeyBase()
Constructor.

◆ FbxAnimCurveKey() [2/4]

FbxAnimCurveKey ( FbxTime  pTime)
inline

Constructor with time.

Parameters
pTimeThe time of key.

Definition at line 362 of file fbxanimcurve.h.

363  {
364  FBX_ASSERT(mAllocatorFct != NULL);
365  mImpl = (*mAllocatorFct)();
366  SetTime(pTime);
367  }
#define NULL
Definition: fbxarch.h:210
FbxAnimCurveKeyBase()
Constructor.
void SetTime(const FbxTime &pTime)
Set time value.
Definition: fbxanimcurve.h:421

◆ FbxAnimCurveKey() [3/4]

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.

374  {
375  FBX_ASSERT(mAllocatorFct != NULL);
376  mImpl = (*mAllocatorFct)();
377  Set(pTime, pVal);
378  }
#define NULL
Definition: fbxarch.h:210
FbxAnimCurveKeyBase()
Constructor.
void Set(FbxTime pTime, float pValue)
Set time and value of key.
Definition: fbxanimcurve.h:430

◆ FbxAnimCurveKey() [4/4]

FbxAnimCurveKey ( FbxAnimCurveKey const &  pFKey)
inline

Copy constructor.

Definition at line 382 of file fbxanimcurve.h.

383  {
384  FBX_ASSERT(mCopyAllocatorFct != NULL);
385  SetTime(pFKey.GetTime());
386  mImpl = mCopyAllocatorFct(pFKey.GetImpl());
387  }
#define NULL
Definition: fbxarch.h:210
FbxAnimCurveKeyBase()
Constructor.
void SetTime(const FbxTime &pTime)
Set time value.
Definition: fbxanimcurve.h:421

◆ ~FbxAnimCurveKey()

~FbxAnimCurveKey ( )
inline

Destructor.

Definition at line 391 of file fbxanimcurve.h.

392  {
393  FBX_ASSERT(mDeallocatorFct != NULL);
394  (*mDeallocatorFct)(mImpl);
395  }
#define NULL
Definition: fbxarch.h:210

Member Function Documentation

◆ operator=()

FbxAnimCurveKey& operator= ( const FbxAnimCurveKey pFKey)
inline

Assignment operator.

Definition at line 399 of file fbxanimcurve.h.

400  {
401  FBX_ASSERT(mImpl);
402  if (mImpl)
403  {
404  *mImpl = *(pFKey.GetImpl());
405  }
406  SetTime(pFKey.GetTime());
407  return *this;
408  }
FbxTime GetTime() const
Get time value.
Definition: fbxanimcurve.h:413
FbxAnimCurveKey_Impl * GetImpl() const
Get key implementation.
Definition: fbxanimcurve.h:687
void SetTime(const FbxTime &pTime)
Set time value.
Definition: fbxanimcurve.h:421

◆ GetTime()

FbxTime GetTime ( ) const
inlinevirtual

Get time value.

Returns
Time value.

Reimplemented from FbxAnimCurveKeyBase.

Examples:
ExportScene03/main.cxx.

Definition at line 413 of file fbxanimcurve.h.

414  {
416  }
virtual FbxTime GetTime() const
Get time value.

◆ SetTime()

void SetTime ( const FbxTime pTime)
inlinevirtual

Set time value.

Parameters
pTimeTime value to set.

Reimplemented from FbxAnimCurveKeyBase.

Definition at line 421 of file fbxanimcurve.h.

422  {
424  }
virtual void SetTime(const FbxTime &pTime)
Set time value.

◆ Set()

void Set ( FbxTime  pTime,
float  pValue 
)
inline

Set time and value of key.

Parameters
pTimeNew time of this key.
pValueNew value of this key.
Examples:
Animation/main.cxx, Audio/main.cxx, ExportScene03/main.cxx, and Pivot/main.cxx.

Definition at line 430 of file fbxanimcurve.h.

431  {
433  mImpl->Set(pTime, pValue);
434  }
virtual void Set(FbxTime pTime, float pValue)=0
Set time and value of key.
virtual void SetTime(const FbxTime &pTime)
Set time value.

◆ SetTCB()

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.

448  {
450  mImpl->SetTCB(pTime, pValue, pData0, pData1, pData2);
451  }
virtual void SetTCB(FbxTime pTime, float pValue, float pData0=0.0f, float pData1=0.0f, float pData2=0.0f)=0
Set a key with cubic interpolation, TCB tangent mode.
virtual void SetTime(const FbxTime &pTime)
Set time value.

◆ GetValue()

float GetValue ( ) const
inline

Get the key value.

Returns
The value of the key.

Definition at line 456 of file fbxanimcurve.h.

457  {
458  return mImpl->GetValue();
459  }
virtual float GetValue() const =0
Get the key value.

◆ SetValue()

void SetValue ( float  pValue)
inline

Set the key value.

Parameters
pValueThe value to set.

Definition at line 464 of file fbxanimcurve.h.

465  {
466  mImpl->SetValue(pValue);
467  }
virtual void SetValue(float pValue)=0
Set the key value.

◆ GetInterpolation()

FbxAnimCurveDef::EInterpolationType GetInterpolation ( )
inline

Get key's interpolation type.

Returns
Interpolation type of the queried key.

Definition at line 473 of file fbxanimcurve.h.

474  {
475  return mImpl->GetInterpolation();
476  }
virtual FbxAnimCurveDef::EInterpolationType GetInterpolation() const =0
Get key&#39;s interpolation type.

◆ SetInterpolation()

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.

482  {
483  mImpl->SetInterpolation(pInterpolation);
484  }
virtual void SetInterpolation(FbxAnimCurveDef::EInterpolationType pInterpolation)=0
Set key&#39;s interpolation type.

◆ GetTangentMode()

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.

493  {
494  return mImpl->GetTangentMode(pIncludeOverrides);
495  }
virtual FbxAnimCurveDef::ETangentMode GetTangentMode(bool pIncludeOverrides=false) const =0
Get key&#39;s tangent mode.

◆ SetTangentMode()

void SetTangentMode ( FbxAnimCurveDef::ETangentMode  pTangentMode)
inline

Set tangent mode.

Parameters
pTangentModeTangent mode to set.

Definition at line 500 of file fbxanimcurve.h.

501  {
502  mImpl->SetTangentMode(pTangentMode);
503  }
virtual void SetTangentMode(FbxAnimCurveDef::ETangentMode pTangentMode)=0
Set tangent mode.

◆ GetTangentWeightMode()

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.
Examples:
ImportScene/DisplayAnimation.cxx.

Definition at line 509 of file fbxanimcurve.h.

510  {
511  return mImpl->GetTangentWeightMode();
512  }
virtual FbxAnimCurveDef::EWeightedMode GetTangentWeightMode() const =0
Get key&#39;s tangent weight mode.

◆ SetTangentWeightMode()

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.

548  {
549  mImpl->SetTangentWeightMode(pTangentWeightMode, pMask);
550  }
virtual void SetTangentWeightMode(FbxAnimCurveDef::EWeightedMode pTangentWeightMode, FbxAnimCurveDef::EWeightedMode pMask=FbxAnimCurveDef::eWeightedAll)=0
Set key&#39;s tangent weight mode as double value (cubic interpolation, non TCB tangent mode)...

◆ SetTangentWeightAndAdjustTangent()

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.

563  {
564  mImpl->SetTangentWeightAndAdjustTangent(pIndex, pWeight);
565  }
virtual void SetTangentWeightAndAdjustTangent(FbxAnimCurveDef::EDataIndex pIndex, double pWeight)=0
Adjust the actual tangent of the key so that the tangent control point (tangent extremity) stays clos...

◆ GetTangentVelocityMode()

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.
Examples:
ImportScene/DisplayAnimation.cxx.

Definition at line 571 of file fbxanimcurve.h.

572  {
573  return mImpl->GetTangentVelocityMode();
574  }
virtual FbxAnimCurveDef::EVelocityMode GetTangentVelocityMode() const =0
Get key&#39;s tangent velocity mode.

◆ SetTangentVelocityMode()

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.

586  {
587  mImpl->SetTangentVelocityMode(pTangentVelocityMode, pMask);
588  }
virtual void SetTangentVelocityMode(FbxAnimCurveDef::EVelocityMode pTangentVelocityMode, FbxAnimCurveDef::EVelocityMode pMask=FbxAnimCurveDef::eVelocityAll)=0
Set key&#39;s tangent velocity mode as double value (cubic interpolation, non TCB tangent mode)...

◆ GetConstantMode()

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.

596  {
597  return mImpl->GetConstantMode();
598  }
virtual FbxAnimCurveDef::EConstantMode GetConstantMode() const =0
Get key constant mode.

◆ SetConstantMode()

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.

605  {
606  mImpl->SetConstantMode(pMode);
607  }
virtual void SetConstantMode(FbxAnimCurveDef::EConstantMode pMode)=0
Set key&#39;s constant mode.

◆ GetDataFloat()

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.

624  {
625  return mImpl->GetDataFloat(pIndex);
626  }
virtual float GetDataFloat(FbxAnimCurveDef::EDataIndex pIndex) const =0
Get the value of specified data of the key.

◆ SetDataFloat()

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.

640  {
641  mImpl->SetDataFloat(pIndex, pValue);
642  }
virtual void SetDataFloat(FbxAnimCurveDef::EDataIndex pIndex, float pValue)=0
Set the value of specified data of the key.

◆ SetTangentVisibility()

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.

649  {
650  mImpl->SetTangentVisibility(pVisibility);
651  }
virtual void SetTangentVisibility(FbxAnimCurveDef::ETangentVisibility pVisibility)=0
Set tangent visibility mode.

◆ GetTangentVisibility()

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.

658  {
659  return mImpl->GetTangentVisibility();
660  }
virtual FbxAnimCurveDef::ETangentVisibility GetTangentVisibility() const =0
Return tangent visibility mode.

◆ SetBreak()

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.

669  {
670  mImpl->SetBreak(pVal);
671  }
virtual void SetBreak(bool pVal)=0
Turn on or turn off the tangent break.

◆ GetBreak()

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.

680  {
681  return mImpl->GetBreak();
682  }
virtual bool GetBreak() const =0
Get if the tangent has a break.

◆ GetImpl()

FbxAnimCurveKey_Impl* GetImpl ( ) const
inline

Get key implementation.

Returns
Pointer to implemented instance.

Definition at line 687 of file fbxanimcurve.h.

688  {
689  return mImpl;
690  }

◆ SetAllocatorFct()

static void SetAllocatorFct ( FbxAnimCurveKey_Impl *(*)()  pAllocatorFct)
static

Set allocator function.

Parameters
pAllocatorFctAllocator function

◆ SetCopyAllocatorFct()

static void SetCopyAllocatorFct ( FbxAnimCurveKey_Impl *(*)(FbxAnimCurveKey_Impl *)  pCopyAllocatorFct)
static

Set copy allocator function.

Parameters
pCopyAllocatorFctCopy allocator function

◆ SetDeallocatorFct()

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: