This reference page is linked to from the following overview topics: FBX SDK 2011, Animation data structures, Migrating to the new data structures for animation, Animation classes and their interrelationships, Evaluating the animation in a scene, List of Python FBX classes.
This class is an composite of animation curves and is called as animation curve node.
Animation curve node is used as the connection point for animation curves and other animation curve nodes associated to a property. KFbxAnimCurveNode can be connected to other KFbxAnimCurveNode, in this case, the destination animation curve node may be considered as "composite", IsComposite(). remarks When created, the KFbxAnimCurveNode has no valid channels unless it is created using the function CreateTypedCurveNode(). This function will add all the required channels to correctly match the number of values of the property. For instance, when CreateTypedCurveNode(pNode.LclTranslation, pScene) is called, the resulting KFbxAnimCurveNode will automatically have 3 channels corresponding to the X,Y and Z components of the LclTranslation property. You can add and remove channels dynamically but can never remove the channels that have been added by the call to CreateTypedCurveNode().
Animation/main.cxx, ImportScene/DisplayAnimation.cxx, Instances/main.cxx, UIExamples/CubeCreator/SDK_Utility.cxx, and UserProperties/main.cxx.
Definition at line 39 of file kfbxanimcurvenode.h.
#include <kfbxanimcurvenode.h>
Public Member Functions |
|
virtual KFbxObject & | Copy (const KFbxObject &pObject) |
Copy an object content into this object.
|
|
void | Evaluate (double *pData, KTime pTime) |
Protected Member Functions |
|
KFbxAnimCurveNode (KFbxSdkManager &pManager, char const *pName) | |
KFbxAnimCurveNode * | Find (KFbxAnimCurveNode *pRoot, const KString &pName) |
virtual bool | ConstructProperties (bool pForceSet) |
virtual void | Destruct (bool pRecursive, bool pDependents) |
Friends |
|
class | KFbxObject |
void | CollectAnimFromCurveNode (KFCurve **lSrc, KFCurveNode *fcn, unsigned int nbCrvs, KFbxAnimCurveNode *cn, KSet *pNickToAnimCurveTimeWarpsSet, KSet &pNickToKFCurveNodeWarpSet) |
Utility functions. |
|
bool | IsAnimated (bool pRecurse=false) const |
Check if the animation curve node contains
any animation key. |
|
K_DEPRECATED bool | GetAnimationInterval (KTime &pStart, KTime &pStop) const |
Find out start and end time of the
animation. |
|
bool | GetAnimationInterval (KTimeSpan &pTimeInterval) const |
Find out start and end time of the
animation. |
|
bool | IsComposite () const |
Test this object to see if it is a composite
KFbxAnimCurveNode or a "leaf". |
|
KFbxAnimCurveNode * | Find (const char *pName) |
Recursively look for the
KFbxAnimCurveNode matching the passed named argument. |
|
unsigned int | GetChannelsCount () const |
Get the total number of property channels
defined in this animation curve node. |
|
int | GetChannelIndex (const char *pChannelName) const |
Get the index of the named channel. |
|
KString | GetChannelName (int pChannelId) const |
Get the name of the channel. |
|
void | ResetChannels () |
Empties the property channels of this
animation curve node. |
|
template<class T > | |
bool | AddChannel (const char *pChnlName, T const &pValue) |
Adds the specified channel property.
|
|
template<class T > | |
void | SetChannelValue (const char *pChnlName, T pValue) |
Set the default value of the channel.
|
|
template<class T > | |
void | SetChannelValue (unsigned int pChnlId, T pValue) |
Set the default value of the channel.
|
|
template<class T > | |
T | GetChannelValue (const char *pChnlName, T pInitVal) |
Get the default value of the channel.
|
|
template<class T > | |
T | GetChannelValue (unsigned int pChnlId, T pInitVal) |
Get the default value of the channel.
|
|
static KFbxAnimCurveNode * | CreateTypedCurveNode (KFbxProperty &pProperty, KFbxScene *pScene) |
Create a
KFbxAnimCurveNode compatible with the specified property data
type. |
|
KFbxAnimCurve management. |
|
bool | DisconnectFromChannel (KFbxAnimCurve *pCurve, unsigned int pChnlId) |
Disconnect the animation curve from the
channel. |
|
bool | ConnectToChannel (KFbxAnimCurve *pCurve, const char *pChnl, bool pInFront=false) |
Connects the given animation curve to the
specified channel. |
|
bool | ConnectToChannel (KFbxAnimCurve *pCurve, unsigned int pChnlId, bool pInFront=false) |
Connects the given animation curve to the
specified channel. |
|
KFbxAnimCurve * | CreateCurve (const char *pCurveNodeName, const char *pChannel) |
Creates a new curve and connects it to the
specified channel of the animation curve node named pCurveNodeName.
|
|
KFbxAnimCurve * | CreateCurve (const char *pCurveNodeName, unsigned int pChannelId=0) |
Creates a new curve and connects it to the
specified channel of the animation curve node named pCurveNodeName.
|
|
int | GetCurveCount (unsigned int pChannelId, const char *pCurveNodeName=NULL) |
Get the number of
KFbxAnimCurve connected to the specified channel. |
|
KFbxAnimCurve * | GetCurve (unsigned int pChannelId, unsigned int pId=0, const char *pCurveNodeName=NULL) |
Get the
KFbxAnimCurve of the specified channel. |
|
Internal use only. |
|
This section is for
internal use and is subject to change without notice. |
|
KFCurveNode * | GetKFCurveNode (bool pNoCreate=false) |
Create the compatible
KFCurveNode structure. |
|
void | ReleaseKFCurveNode () |
Destroy the
KFCurveNode structure. |
|
void | SyncChannelsWithKFCurve () |
Sync the each channel property with the
KFCurve's mValue stored in the
KFCurveNode. |
|
bool | UseQuaternionInterpolation () |
bool | SetQuaternionInterpolation (unsigned short pVal) |
Returns false if pVal is an
invalid value. |
|
unsigned short | GetQuaternionInterpolation () |
void | SetKFCurveNodeLayerType (KFbxProperty &pProp) |
static const char * | CurveNodeNameFrom (const char *pName) |
KFbxAnimCurveNode | ( | KFbxSdkManager & | pManager, |
char const * | pName | ||
) | [protected] |
bool IsAnimated | ( | bool | pRecurse = false |
) | const |
Check if the animation curve node contains any animation key.
pRecurse | true to descend to the children if the animation
curve node is composite. |
true
if at least one animation curve is found and
it contains at least one animation key, \ false
otherwise.Find out start and end time of the animation.
This function retrieves the including time span for all animation curves of this animation curve node.
pStart | Reference to receive start time. |
pStop | Reference to receive end time. |
true
on success, false
otherwise.false
is also returned if this animation curve
node has no animation.bool GetAnimationInterval | ( | KTimeSpan & | pTimeInterval | ) | const |
Find out start and end time of the animation.
This function retrieves the including time span for all animation curves of this animation curve node.
pTimeInterval | Reference to receive start time and end time. |
true
on success, false
otherwise.false
is also returned if this animation curve
node has no animation.bool IsComposite | ( | ) | const |
Test this object to see if it is a composite KFbxAnimCurveNode or a "leaf".
A composite KFbxAnimCurveNode is a KFbxAnimCurveNode whose all source connections are KFbxAnimCurveNode and its property channels is totally empty. It is just a container to take other KFbxAnimCurveNode.
true
if this object is a composite,
false
otherwise.KFbxAnimCurveNode* Find | ( | const char * | pName | ) |
Recursively look for the KFbxAnimCurveNode matching the passed named argument.
pName | Name of the KFbxAnimCurveNode we are looking for. |
static KFbxAnimCurveNode* CreateTypedCurveNode | ( | KFbxProperty & | pProperty, |
KFbxScene * | pScene | ||
) | [static] |
Create a KFbxAnimCurveNode compatible with the specified property data type.
pProperty | The property that needs a KFbxAnimCurveNode. |
pScene | The scene the created KFbxAnimCurveNode will belong to. |
unsigned int GetChannelsCount | ( | ) | const |
Get the total number of property channels defined in this animation curve node.
For composite animation curve nodes, since they do not contain any channels, this function will always return 0.
int GetChannelIndex | ( | const char * | pChannelName | ) | const |
Get the index of the named channel.
pChannelName | Name of the channel for which we want the index. |
KString GetChannelName | ( | int | pChannelId | ) | const |
Get the name of the channel.
pChannelId | Index of the channel for which we want the name. |
void ResetChannels | ( | ) |
Empties the property channels of this animation curve node.
bool AddChannel | ( | const char * | pChnlName, |
T const & | pValue | ||
) | [inline] |
Adds the specified channel property.
pChnlName | Channel name. |
pValue | Default value of the channel. |
true
if successful, false
otherwise.Definition at line 131 of file kfbxanimcurvenode.h.
{ if (!pChnlName || strlen(pChnlName)==0) return false; KFbxProperty c = GetChannel(pChnlName); if (c.IsValid()) { return false; } mChannels.BeginCreateOrFindProperty(); KFbxDataType dt = GetFbxDataType(FbxTypeOf(pValue)); c = KFbxProperty::Create(mChannels, dt, pChnlName); KFbxSet<T>(c, pValue); mChannels.EndCreateOrFindProperty(); return true; }
void SetChannelValue | ( | const char * | pChnlName, |
T | pValue | ||
) | [inline] |
Set the default value of the channel.
pChnlName | Channel name. |
pValue | New default value of this channel. |
Definition at line 152 of file kfbxanimcurvenode.h.
{ KFbxProperty c = GetChannel(pChnlName); if (c.IsValid()) KFbxSet<T>(c, pValue); }
void SetChannelValue | ( | unsigned int | pChnlId, |
T | pValue | ||
) | [inline] |
Set the default value of the channel.
pChnlId | Channel index. |
pValue | New default value of this channel. |
Definition at line 162 of file kfbxanimcurvenode.h.
{ KFbxProperty c = GetChannel(pChnlId); if (c.IsValid()) KFbxSet<T>(c, pValue); }
T GetChannelValue | ( | const char * | pChnlName, |
T | pInitVal | ||
) | [inline] |
Get the default value of the channel.
pChnlName | Channel name. |
pInitVal | Value returned if the specified channel is invalid. |
Definition at line 173 of file kfbxanimcurvenode.h.
{ T v = pInitVal; KFbxProperty c = GetChannel(pChnlName); if (c.IsValid()) KFbxGet<T>(c, v); return v; }
T GetChannelValue | ( | unsigned int | pChnlId, |
T | pInitVal | ||
) | [inline] |
Get the default value of the channel.
pChnlId | Channel index. |
pInitVal | Value returned if the specified channel is invalid. |
Definition at line 186 of file kfbxanimcurvenode.h.
{ T v = pInitVal; KFbxProperty c = GetChannel(pChnlId); if (c.IsValid()) KFbxGet<T>(c, v); return v; }
bool DisconnectFromChannel | ( | KFbxAnimCurve * | pCurve, |
unsigned int | pChnlId | ||
) |
Disconnect the animation curve from the channel.
pCurve | The curve to disconnect from the channel. |
pChnlId | The channel index. |
true
if the disconnection was made,
false
if an error occurred.bool ConnectToChannel | ( | KFbxAnimCurve * | pCurve, |
const char * | pChnl, | ||
bool | pInFront =
false |
||
) |
Connects the given animation curve to the specified channel.
pCurve | The curve to connect to the channel. |
pChnl | The name of the channel the curve is to be connected to. |
pInFront | When true , all the current connections are moved
after this one, making this one the first. By default, the
connection is the last one. |
true
if the connection was made,
false
if an error occurred.bool ConnectToChannel | ( | KFbxAnimCurve * | pCurve, |
unsigned int | pChnlId, | ||
bool | pInFront =
false |
||
) |
Connects the given animation curve to the specified channel.
pCurve | The curve to connect to the channel. |
pChnlId | Index of the channel the curve is to be connected to. |
pInFront | When true , all the current connections are moved
after this one. making this one the first. By default, the
connection is the last one. |
true
if the connection was made,
false
if an error occurred.KFbxAnimCurve* CreateCurve | ( | const char * | pCurveNodeName, |
const char * | pChannel | ||
) |
Creates a new curve and connects it to the specified channel of the animation curve node named pCurveNodeName.
this animation curve node is composite, this function will try to search all children animation curve nodes for the one named pCurveNodeName.
pCurveNodeName | Name of the KFbxAnimCurveNode we are looking for. |
pChannel | Channel identifier. |
KFbxAnimCurve* CreateCurve | ( | const char * | pCurveNodeName, |
unsigned int | pChannelId =
0 |
||
) |
Creates a new curve and connects it to the specified channel of the animation curve node named pCurveNodeName.
If this animation curve node is composite, this function will try to search all children animation curve nodes recursively for the one named pCurveNodeName.
pCurveNodeName | Name of the KFbxAnimCurveNode we are looking for. |
pChannelId | Channel index. |
int GetCurveCount | ( | unsigned int | pChannelId, |
const char * | pCurveNodeName =
NULL |
||
) |
Get the number of KFbxAnimCurve connected to the specified channel.
If this animation curve node is composite, this function will try to search all children animation curve nodes recursively for the one named pCurveNodeName.
pChannelId | Channel index. |
pCurveNodeName | Name of the KFbxAnimCurveNode we are looking for. |
KFbxAnimCurve* GetCurve | ( | unsigned int | pChannelId, |
unsigned int | pId = 0 , |
||
const char * | pCurveNodeName =
NULL |
||
) |
Get the KFbxAnimCurve of the specified channel.
If this animation curve node is composite, this function will try to search all children animation curve nodes recursively for the one named pCurveNodeName.
pChannelId | Channel index. |
pId | The index of the desired anim curve (in case there is more than one) |
pCurveNodeName | Name of the KFbxAnimCurveNode we are looking for (if this object is a composite). |
virtual KFbxObject& Copy | ( | const KFbxObject & | pObject | ) | [virtual] |
Copy an object content into this object.
pObject | The source object to copy data from. |
Reimplemented from KFbxObject.
void Evaluate | ( | double * | pData, |
KTime | pTime | ||
) |
KFCurveNode* GetKFCurveNode | ( | bool | pNoCreate = false |
) |
Create the compatible KFCurveNode structure.
This method will create a temporary KFCurveNode object and all the necessary children to represent all the connections of this KFbxAnimCurveNode. Each call to this method will clear the previous content of the KFCurveNode but does not destroy it. An explicit call to ReleaseKFCurveNode has to be made.
void ReleaseKFCurveNode | ( | ) |
Destroy the KFCurveNode structure.
This method will destroy the KFCurveNode that has been created by the call to GetKFCurveNode.
void SyncChannelsWithKFCurve | ( | ) |
Sync the each channel property with the KFCurve's mValue stored in the KFCurveNode.
bool UseQuaternionInterpolation | ( | ) | [inline] |
Definition at line 316 of file kfbxanimcurvenode.h.
{return mQuaternionInterpolation != 0;};
bool SetQuaternionInterpolation | ( | unsigned short | pVal | ) |
Returns false if pVal
is an invalid value.
unsigned short GetQuaternionInterpolation | ( | ) | [inline] |
Definition at line 320 of file kfbxanimcurvenode.h.
{ return mQuaternionInterpolation; };
void SetKFCurveNodeLayerType | ( | KFbxProperty & | pProp | ) |
static const char* CurveNodeNameFrom | ( | const char * | pName | ) | [static] |
KFbxAnimCurveNode* Find | ( | KFbxAnimCurveNode * | pRoot, |
const KString & | pName | ||
) | [protected] |
virtual bool ConstructProperties | ( | bool | pForceSet | ) | [protected, virtual] |
Reimplemented from KFbxObject.
virtual void Destruct | ( | bool | pRecursive, |
bool | pDependents | ||
) | [protected, virtual] |
Reimplemented from KFbxObject.
friend class KFbxObject [friend] |
Reimplemented from KFbxPlug.
Definition at line 352 of file kfbxanimcurvenode.h.
void CollectAnimFromCurveNode | ( | KFCurve ** | lSrc, |
KFCurveNode * | fcn, | ||
unsigned int | nbCrvs, | ||
KFbxAnimCurveNode * | cn, | ||
KSet * | pNickToAnimCurveTimeWarpsSet, | ||
KSet & | pNickToKFCurveNodeWarpSet | ||
) | [friend] |