#include<kfcurvenode.h>
It is a composite class that contains curve node tree management services in itself. Cyclic graphs are forbidden in a curve node hierarchy.
Definition at line369of filekfcurvenode.h.
Constructors and Destructor | |
KFCurveNode(char *pNodeName, char *pTimeWarpName, HKDataType pDataType, int pLayerType=KFCL_NOLAYER, int pLayerID=0) | |
Constructor. | |
KFCurveNode(HKFCurveNodepTemplateCurveNode) | |
Template constructor. | |
virtual | ~KFCurveNode() |
Destructor. | |
FCurve Creation | |
void | CreateFCurve() |
Create the FCurve for this node. | |
bool | FCurveCreated() |
Test to know if the FCurve is created. | |
Cloning and Copy Functions | |
HKFCurveNode | Clone(bool pKeepAttached) |
Return a duplicate of this node. | |
HKFCurveNode | CloneTemplate(bool pKeepAttached=false, bool pCloneFCurves=false, bool pCreateCurves=false, int pLayerID=-1) |
Return a duplicate of this node. | |
void | CopyFrom(HKFCurveNodepSource, bool pTransferCurve=false) |
Copy the function curve contained in the given curve node. | |
HKFCurveNode | Copy(KTimepStart=KTIME_MINUS_INFINITE,KTimepStop=KTIME_INFINITE) |
Create a copy of the current curve node. | |
Node Identification | |
char * | GetName() |
Retrieve the node's name. | |
char * | GetTimeWarpName() |
Retrieve the node's timewrap name. | |
char * | GetTypeName() |
Retrieve the node type name. | |
Function Curve Management | |
HKFCurve | FCurveGet() |
Get pointer to the node's function curve. | |
KFCurve* | FCurveSet(KFCurve*pCurve, bool pDestroyOldCurve=false) |
Set the function curve of this curve node. | |
void | FCurveReplace(KFCurve*pCurve) |
Replace the function curve of this curve node. | |
bool | GetTransformCurves(KFCurve*pT[3],KFCurve*pR[3],KFCurve*pS[3]) |
Return translation, rotation and scaling curves of the children of this curve node. | |
Curve Node Management | |
virtual void | Clear() |
Clear this node. | |
virtual int | Add(HKFCurveNodepCurveNode) |
Add a child curve node to this node. | |
virtual void | Remove(int pIndex) |
Remove a child curve node by index. | |
virtual void | Delete(int pIndex) |
Remove and delete a child curve node by index. | |
virtual int | GetCount() |
Get children curve nodes count. | |
virtualHKFCurveNode | Get(int pIndex) |
Get pointer to child curve node by index. | |
virtual bool | IsChild(KFCurveNode*pCurveNode, bool pRecursive=false) |
Ask if a given curve node is a child of the current curve node. | |
virtual int | Find(char *pName) |
Get index of child curve node by name. | |
virtual int | Find(HKFCurveNodepNode) |
Get index of child curve node by pointer. | |
HKFCurveNode | FindRecursive(char *pName) |
Recursively find the first child curve node by name. | |
HKFCurveNode | FindOrCreate(char *pName, bool pFindOrCreateCurve=true) |
Find a child node by name or create it if it can not be found. | |
virtual void | SetParent(HKFCurveNodepParent) |
Set the parent curve node. | |
virtualHKFCurveNode | GetParent() |
Get the parent curve node. | |
Key Management | |
int | KeyGetCount(bool pRecursiveInLayers=false) |
Get the number of animation keys. | |
void | KeyGetCount(int&pCurveCount, int&pTotalCount, int&pMinCount, int&pMaxCount) |
Get the number of animation keys. | |
void | GetCurveWithFirstKey(KFCurve*&lCurveWithFirstKey, bool *pCurveMask, bool pRecursiveInLayers) |
Get the fcurve that has the earliest key. | |
void | GetCurveWithLastKey(KFCurve*&lCurveWithLastKey, bool *pCurveMask, bool pRecursiveInLayers) |
Get the fcurve that has the latest key. | |
KTime | GetFirstKeyTime(bool *pCurveMask=NULL, bool pRecursiveInLayers=false) |
Get the first key time in the children specified by the curve mask (NULL = all children) If there is no key, return KTIME_MINUS_INFINITE. | |
KTime | GetLastKeyTime(bool *pCurveMask=NULL, bool pRecursiveInLayers=false) |
Get the last key time in the children specified by the curve mask (NULL = all children) If there is no key, return KTIME_INFINITE. | |
double * | KeyAdd(KTimepTime, double *pValue) |
Recursively add a set of keys in the curve node tree. | |
double * | KeyAppend(KTimepTime, double *pValue, bool pCheckForContinuousRotation=false) |
Recursively append a set of keys in the curve node tree. | |
bool | GetAnimationInterval(KTime&pStart,KTime&pStop) |
Find out start and stop time of the animation for a curve node and recursively in its children. | |
void | GetTimeSpan(KTime&pStart,KTime&pStop) |
Find out start and stop time of the animation for a curve node and recursively in it's children. | |
int | IsKey(KTime&pTime, int *pLast, bool *pCurveMask=NULL, double pKeyIndexTolerance=0.0, double pMin=-K_DOUBLE_MAX, double pMax=K_DOUBLE_MAX) |
Recursively check if keys exist at a given time in the curve node tree. | |
bool | DeleteKey(KTime&pTime, bool *pCurveMask=NULL, double pKeyIndexTolerance=0.0) |
Recursively delete keys at a given time in the curve node tree. | |
KTime | GetNextKeyTime(KTimepTime, bool *pCurveMask=NULL, bool pRecursiveInLayers=false) |
Recursively find the closest later time at which a key can be found compared to a given time. | |
KTime | GetPrevKeyTime(KTimepTime, bool *pCurveMask=NULL) |
Recursively find the closest ealier time at which a key can be found compared to a given time. | |
double * | Evaluate(double *pValue,KTimepTime, kFCurveIndex *pLast=NULL) |
Recursively evaluate the curve node tree. | |
double * | GetValue(double *pValue) |
Recursively get the default values of the curve node tree. | |
double * | SetValue(double *pValue) |
Recursively set the default values of the curve node tree. | |
void | Delete(KTimepStart=KTIME_MINUS_INFINITE,KTimepStop=KTIME_INFINITE) |
Delete all the keys found within a given time range. | |
void | Replace(HKFCurveNodepSource,KTimepStart=KTIME_MINUS_INFINITE,KTimepStop=KTIME_INFINITE, bool pUseGivenSpan=false, bool pKeyStartEndOnNoKey=true,KTimepTimeSpanOffset=KTIME_ZERO) |
Replace all the keys found within a given time range. |
KFCurveNode | ( | char * | pNodeName, | |
char * | pTimeWarpName, | |||
HKDataType | pDataType, | |||
int | pLayerType=KFCL_NOLAYER , | |||
int | pLayerID=0 | |||
) |
Constructor.
pNodeName | Curve node name. | |
pTimeWarpName | Curve node. | |
pDataType | Curve node type. | |
pLayerType | LayerType. | |
pLayerID | LayerID. |
KFCurveNode | ( | HKFCurveNode | pTemplateCurveNode | ) |
Template constructor.
pTemplateCurveNode | Template curve node. |
virtual ~KFCurveNode | ( | ) | [virtual] |
Destructor.
void CreateFCurve | ( | ) |
Create the FCurve for this node.
This function is called recursively for all children curve nodes.
bool FCurveCreated | ( | ) |
Test to know if the FCurve is created.
This function is called recursively for all children curve nodes. It returns false as soon as one child does not have its FCurve.
HKFCurveNodeClone | ( | bool | pKeepAttached | ) |
Return a duplicate of this node.
This function is called recursively for all children curve nodes. The function curve is copied in the new curve node.
pKeepAttached | Iftrue , the created object will share a structure that defines the node name, node display name and node type name. Otherwise, this structure is copied. |
pCloneFCurves
set totrue
.HKFCurveNodeCloneTemplate | ( | bool | pKeepAttached=false , | |
bool | pCloneFCurves=false , | |||
bool | pCreateCurves=false , | |||
int | pLayerID=-1 | |||
) |
Return a duplicate of this node.
This function is called recursively for all children curve nodes.
pKeepAttached | Iftrue , the created object will share a structure that defines the node name, node display name and node type name. Otherwise, this structure is copied. | |
pCloneFCurves | Iftrue and the current curve node has a function curve, the function curve is copied in the new curve node. | |
pCreateCurves | Iftrue ,pCloneFCurve is set tofalse and the current curve node has a function curve, an empty function curve is created in the new curve node. | |
pLayerID | LayerID. |
void CopyFrom | ( | HKFCurveNode | pSource, | |
bool | pTransferCurve=false | |||
) |
Copy the function curve contained in the given curve node.
pSource | Given curve node to copy the function curve from. | |
pTransferCurve | Iftrue , curve data is transferred instead of being copied. |
pSource
is copied in the first child curve node of the current object and so on.HKFCurveNodeCopy | ( | KTime | pStart=KTIME_MINUS_INFINITE , | |
KTime | pStop=KTIME_INFINITE | |||
) |
Create a copy of the current curve node.
The structure defining the node name, node display name and node type name is copied, not shared. Only the animation keys in a given time range are copied.
pStart | Start time for range of animation keys copied. | |
pStop | Stop time for range of animation keys copied. |
char* GetName | ( | ) |
Retrieve the node's name.
char* GetTimeWarpName | ( | ) |
Retrieve the node's timewrap name.
char* GetTypeName | ( | ) |
Retrieve the node type name.
HKFCurveFCurveGet | ( | ) |
Get pointer to the node's function curve.
NULL
pointer if there's none.Set the function curve of this curve node.
pCurve | New function curve. | |
pDestroyOldCurve | Set totrue to delete the function curve already contained in the curve node. |
pDestroyOldCurve
is set tofalse
. Otherwise,NULL
is returned.void FCurveReplace | ( | KFCurve* | pCurve | ) |
Replace the function curve of this curve node.
Previous function curve is automatically destroyed.
pCurve | New function curve. |
pDestroyOldCurve
set totrue
.Return translation, rotation and scaling curves of the children of this curve node.
This function is meant to be called on the rootKFCurveNodeobject found in classKFbxTakeNode.
pT | Array to receive X, Y and Z translation function curves. | |
pR | Array to receive X, Y and Z rotation function curves. | |
pS | Array to receive X, Y and Z scaling function curves. |
true
if all function curves have been found,false
otherwise.virtual void Clear | ( | ) | [virtual] |
Clear this node.
Delete the function curve and all the children curve nodes.
virtual int Add | ( | HKFCurveNode | pCurveNode | ) | [virtual] |
Add a child curve node to this node.
pCurveNode | The child curve node to be added. |
virtual void Remove | ( | int | pIndex | ) | [virtual] |
Remove a child curve node by index.
pIndex | Index of child curve node to be removed. |
virtual void Delete | ( | int | pIndex | ) | [virtual] |
Remove and delete a child curve node by index.
pIndex | Index of child curve node to be deleted. |
virtual int GetCount | ( | ) | [virtual] |
Get children curve nodes count.
virtualHKFCurveNodeGet | ( | int | pIndex | ) | [virtual] |
Get pointer to child curve node by index.
pIndex | Index of child curve node. |
NULL
is index is out of bounds.virtual bool IsChild | ( | KFCurveNode* | pCurveNode, | |
bool | pRecursive=false | |||
) | [virtual] |
Ask if a given curve node is a child of the current curve node.
pCurveNode | Curve node searched. | |
pRecursive | Set totrue to search recursively. Set tofalse to search only in the immediate children curve nodes. |
true
if the curve node searched is found,false
otherwise.virtual int Find | ( | char * | pName | ) | [virtual] |
Get index of child curve node by name.
pName | Name of searched child curve node. |
virtual int Find | ( | HKFCurveNode | pNode | ) | [virtual] |
Get index of child curve node by pointer.
pNode | Pointer to searched child curve node. |
HKFCurveNodeFindRecursive | ( | char * | pName | ) |
Recursively find the first child curve node by name.
pName | Name of searched child curve node. |
NULL
if this name could not be found.HKFCurveNodeFindOrCreate | ( | char * | pName, | |
bool | pFindOrCreateCurve=true | |||
) |
Find a child node by name or create it if it can not be found.
pName | Name of child node to find. | |
pFindOrCreateCurve | Iftrue and the function curve does not exist, create one in the curve node found or created. |
virtual void SetParent | ( | HKFCurveNode | pParent | ) | [inline, virtual] |
Set the parent curve node.
pParent | The parent curve node to be set. |
Definition at line620of filekfcurvenode.h.
virtualHKFCurveNodeGetParent | ( | ) | [inline, virtual] |
Get the parent curve node.
NULL
if there is none.Definition at line625of filekfcurvenode.h.
int KeyGetCount | ( | bool | pRecursiveInLayers=false | ) |
Get the number of animation keys.
pRecursiveInLayers | Return the total number of keys contained in the function curves included in the current node and its children curve nodes. |
void KeyGetCount | ( | int& | pCurveCount, | |
int& | pTotalCount, | |||
int& | pMinCount, | |||
int& | pMaxCount | |||
) |
Get the number of animation keys.
pCurveCount | returns the number of fcurves held by this node | |
pTotalCount | returns the number of keys on all the fcurves held by this node | |
pMinCount | returns the minimum number of keys on an fcurve held by this node | |
pMaxCount | returns the maximum number of keys on an fcurve held by this node |
void GetCurveWithFirstKey | ( | KFCurve*& | lCurveWithFirstKey, | |
bool * | pCurveMask, | |||
bool | pRecursiveInLayers | |||
) |
Get the fcurve that has the earliest key.
If many fcurves has a key at the earliest time, returns one of the fcurves.
lCurveWithFirstKey | The fcurve has the earliest key. | |
pCurveMask | Allows you to use only specific children in the CurveNode. NULL means all of them. | |
pRecursiveInLayers |
void GetCurveWithLastKey | ( | KFCurve*& | lCurveWithLastKey, | |
bool * | pCurveMask, | |||
bool | pRecursiveInLayers | |||
) |
Get the fcurve that has the latest key.
If many fcurves has a key at the latest time, returns one of the fcurves.
lCurveWithLastKey | The fcurve has last key. | |
pCurveMask | Allows you to use only specific children in the CurveNode. NULL means all of them. | |
pRecursiveInLayers |
KTimeGetFirstKeyTime | ( | bool * | pCurveMask=NULL , | |
bool | pRecursiveInLayers=false | |||
) |
Get the first key time in the children specified by the curve mask (NULL = all children) If there is no key, return KTIME_MINUS_INFINITE.
pCurveMask | Allows you to use only specific children in the CurveNode. NULL means all of them. | |
pRecursiveInLayers |
KTimeGetLastKeyTime | ( | bool * | pCurveMask=NULL , | |
bool | pRecursiveInLayers=false | |||
) |
Get the last key time in the children specified by the curve mask (NULL = all children) If there is no key, return KTIME_INFINITE.
pCurveMask | Allows you to use only specific children in the CurveNode. NULL means all of them. | |
pRecursiveInLayers |
double* KeyAdd | ( | KTime | pTime, | |
double * | pValue | |||
) |
Recursively add a set of keys in the curve node tree.
Depth first key adding in the function curves included in the current node and its children curve nodes.
pTime | Time to add the keys. | |
pValue | Array containing all the key values. This array must contain as many elements as the number of function curves included in the current node and its children curve nodes. |
pValue
added with an offset equal to the number of affected function curves timessizeof(kDouble)
.double* KeyAppend | ( | KTime | pTime, | |
double * | pValue, | |||
bool | pCheckForContinuousRotation=false | |||
) |
Recursively append a set of keys in the curve node tree.
Depth first key appending in the function curves included in the current node and its children curve nodes.
pTime | Time set in the appended keys. Make sure this time has a greater value than any of the last keys in the affected function curves. | |
pValue | Array containing all the key values. This array must contain as many elements as the number of function curves included in the current node and its children curve nodes. | |
pCheckForContinuousRotation | Flag, when set to true we will check for continuous rotation values. This is like an unroll filter on the fly. Relevant only for rotation fcurve nodes. |
pValue
added with an offset equal to the number of function curves affected timessizeof(kDouble)
.Find out start and stop time of the animation for a curve node and recursively in its children.
pStart | Reference to store start time.pStart is overwritten only if the start time found is lower thanpStart value. Initialize to KTIME_INFINITE to make sure the start time is overwritten in any case. | |
pStop | Reference to store end time.pStop is overwritten only if the stop time found is higher thanpStop value. Initialize to KTIME_MINUS_INFINITE to make sure the stop time is overwritten in any case. |
true
if at least one key has been found in all the function curves scanned.Find out start and stop time of the animation for a curve node and recursively in it's children.
pStart | Reference to receive the smaller key time, set to KTIME_INFINITE if no key could be found. | |
pStop | Reference to receive the larger key time, set to KTIME_MINUS_INFINITE if no key could be found. |
int IsKey | ( | KTime& | pTime, | |
int * | pLast, | |||
bool * | pCurveMask=NULL , | |||
double | pKeyIndexTolerance=0.0 , | |||
double | pMin=-K_DOUBLE_MAX , | |||
double | pMax=K_DOUBLE_MAX | |||
) |
Recursively check if keys exist at a given time in the curve node tree.
Check if a key exists at the given time in the function curves included in the current node and its children curve nodes.
pTime | Given time to check key occurence. | |
pLast | Function curve index to speed up search. If this function is called in a loop, initialize this value to 0 and let it be updated by each call. | |
pCurveMask | allows you to use only specific children in the CurveNode. NULL means all of them. | |
pKeyIndexTolerance | allows the test to be less strict when matching the time with a key index. | |
pMin | Minimal Value to Consider the Key. | |
pMax | Maximal Value to Consider the Key. |
ISKEY_NONE
if no function curve has a key at the given time,ISKEY_SOME
if some function curves have a key at the given time orISKEY_ALL
if all function curves have a key at the given time.bool DeleteKey | ( | KTime& | pTime, | |
bool * | pCurveMask=NULL , | |||
double | pKeyIndexTolerance=0.0 | |||
) |
Recursively delete keys at a given time in the curve node tree.
Delete keys at the given time in the function curves included in the current node and its children curve nodes.
pTime | Given time to delete keys. | |
pCurveMask | allows you to use only specific children in the CurveNode. NULL means all of them. | |
pKeyIndexTolerance | allows to be less strict when matching the time with a key index. |
true
if at least one key has been found at the given time and deleted.Recursively find the closest later time at which a key can be found compared to a given time.
Find the closest but later time at which a key can be found compared to a given time in the function curves included in the current node and its children curve nodes.
pTime | Given time to search the next key time. | |
pCurveMask | allows you to use only specific children in the CurveNode. NULL means all of them. | |
pRecursiveInLayers |
Recursively find the closest ealier time at which a key can be found compared to a given time.
Find the closest earlier time at which a key can be found compared to a given time in the function curves included in the current node and its children curve nodes.
pTime | Given time to search the previous key time. | |
pCurveMask | allows you to use only specific children in the CurveNode. NULL means all of them. |
double* Evaluate | ( | double * | pValue, | |
KTime | pTime, | |||
kFCurveIndex * | pLast=NULL | |||
) |
Recursively evaluate the curve node tree.
Depth first evaluation of the function curves included in the current node and its children curve nodes.
pValue | Array to receive all the function curve evaluations. This array must be long enough to contain as many elements as the number of function curves included in the current node and its children curve nodes. | |
pTime | Time of evaluation. | |
pLast | Function curve index to speed up evaluation. If this function is called in a loop, initialize this value to 0 and let it be updated by each call. |
pValue
added with an offset equal to the number of function curves evaluated timessizeof(double)
.double* GetValue | ( | double * | pValue | ) |
Recursively get the default values of the curve node tree.
Depth first access to the default values of the function curves included in the current node and its children curve nodes.
pValue | Array to receive all the function curve default values. This array must be long enough to contain as many elements as the number of function curves included in the current node and its children curve nodes. |
pValue
added with an offset equal to the number of function curves accessed timessizeof(double)
.double* SetValue | ( | double * | pValue | ) |
Recursively set the default values of the curve node tree.
Depth first setting of the default values of the function curves included in the current node and its children curve nodes.
pValue | Array containing all the function curve default values. This array must contain as many elements as the number of function curves included in the current node and its children curve nodes. |
pValue
added with an offset equal to the number of function curves set timessizeof(double)
.Delete all the keys found within a given time range.
Delete all the keys found within a given time range in the function curves included in the current node and its children curve nodes.
pStart | Beginning of time range. | |
pStop | End of time range. |
void Replace | ( | HKFCurveNode | pSource, | |
KTime | pStart=KTIME_MINUS_INFINITE , | |||
KTime | pStop=KTIME_INFINITE , | |||
bool | pUseGivenSpan=false , | |||
bool | pKeyStartEndOnNoKey=true , | |||
KTime | pTimeSpanOffset=KTIME_ZERO | |||
) |
Replace all the keys found within a given time range.
Replace all the keys found within a given time range in the function curves included in the current node and its children curve nodes.
pSource | Source node tree containing the replacement keys. The curve node tree belowpSource must be identical to the curve node tree below the current node. | |
pStart | Beginning of time range. | |
pStop | End of time range. | |
pUseGivenSpan | false = original behavior where the time of the first and last key was used | |
pKeyStartEndOnNoKey | Inserts a key at the beginning and at the end of the range if there is no key to insert. | |
pTimeSpanOffset |