This reference page is linked to from the following overview topics: List of Python FBX classes.
Class for clusters (links).
A cluster, or link, is an entity acting on a geometry (KFbxGeometry). More precisely, the cluster acts on a subset of the geometry's control points. For each control point that the cluster acts on, the intensity of the cluster's action is modulated by a weight. The link mode (ELinkMode) specifies how the weights are taken into account.
The cluster's link node specifies the node (KFbxNode) that influences the control points of the cluster. If the node is animated, the control points will move accordingly.
A cluster is usually part of a skin (see KFbxDeformer, KFbxSkin). For example, imagine a mesh representing a humanoid, and imagine a skeleton made of bones. Each bone is represented by a node in FBX. To bind the geometry to the nodes, we create a skin (KFbxSkin). The skin has many clusters, each one corresponding to a bone. Each node influences some control points of the mesh. A node has a high influence on some of the points (high weight) and lower influence on some other points (low weight). Some points of the mesh are not affected at all by the bone, so they would not be part of the corresponding cluster.
ExportScene01/main.cxx, ImportScene/DisplayLink.cxx, SwitchBinding/main.cxx, and ViewScene/DrawScene.cxx.
Definition at line 82 of file kfbxcluster.h.
#include <kfbxcluster.h>
Public Member Functions |
|
void | SetControlPointIWCount (int pCount) |
Set the array size for the three arrays: the
array of control point indices, the array of weights and the array
of blend weights. |
|
virtual KFbxObject & | Copy (const KFbxObject &pObject) |
Copy an object content into this object.
|
|
Public Attributes |
|
KString | mBeforeVersion6LinkName |
KString | mBeforeVersion6AssociateModelName |
Protected Member Functions |
|
KFbxCluster (KFbxSdkManager &pManager, char const *pName) | |
virtual void | Construct (const KFbxCluster *pFrom) |
virtual bool | ConstructProperties (bool pForceSet) |
virtual KStringList | GetTypeFlags () const |
Protected Attributes |
|
ELinkMode | mLinkMode |
KString | mUserDataID |
KString | mUserData |
KArrayTemplate< int > | mControlPointIndices |
KArrayTemplate< double > | mControlPointWeights |
KFbxMatrix | mTransform |
KFbxMatrix | mTransformLink |
KFbxMatrix | mTransformAssociate |
KFbxMatrix | mTransformParent |
bool | mIsTransformParentSet |
KFbxTypedProperty< fbxReference > | SrcModel |
KFbxTypedProperty< fbxReference > | SrcModelReference |
Friends |
|
class | KFbxScene |
General Functions |
|
ESubDeformerType | GetSubDeformerType () const |
Get the type of the sub deformer. |
|
void | Reset () |
Restore the cluster to its initial state.
|
|
Link Mode, Link Node, Associate Model |
|
enum | ELinkMode { eNORMALIZE, eADDITIVE, eTOTAL1 } |
Link modes. More... |
|
void | SetLinkMode (ELinkMode pMode) |
Set the link mode. |
|
ELinkMode | GetLinkMode () const |
Get the link mode. |
|
void | SetLink (KFbxNode const *pNode) |
Set the link node. |
|
KFbxNode * | GetLink () |
Get the link node. |
|
KFbxNode const * | GetLink () const |
Get the link node (as const). |
|
void | SetAssociateModel (KFbxNode *pNode) |
Set the associate model. |
|
KFbxNode * | GetAssociateModel () const |
Get the associate model. |
|
Control Points |
|
A link has an array of
indices to control points and associated weights.The indices refer
to the control points in the instance of class
KFbxGeometry owning the link. The weights are the influence of
the link node over the displacement of the indexed control
points. |
|
void | AddControlPointIndex (int pIndex, double pWeight) |
Add an element in both arrays of control
point indices and weights. |
|
int | GetControlPointIndicesCount () const |
Get the length of the arrays of control
point indices and weights. |
|
int * | GetControlPointIndices () const |
Get the array of control point indices.
|
|
double * | GetControlPointWeights () const |
Get the array of control point weights.
|
|
Transformation Matrices |
|
A link has three
transformation matrices:
For example, given a mesh binding with several bones(links),
Transform is the global transform of the mesh at the binding
moment, TransformLink is the global transform of the bone(link) at
the binding moment, TransformAssociateModel is the global transform
of the associate model at the binding moment. |
|
void | SetTransformMatrix (const KFbxXMatrix &pMatrix) |
Set matrix associated with the node
containing the link. |
|
KFbxXMatrix & | GetTransformMatrix (KFbxXMatrix &pMatrix) const |
Get matrix associated with the node
containing the link. |
|
void | SetTransformLinkMatrix (const KFbxXMatrix &pMatrix) |
Set matrix associated with the link node.
|
|
KFbxXMatrix & | GetTransformLinkMatrix (KFbxXMatrix &pMatrix) const |
Get matrix associated with the link node.
|
|
void | SetTransformAssociateModelMatrix (const KFbxXMatrix &pMatrix) |
Set matrix associated with the associate
model. |
|
KFbxXMatrix & | GetTransformAssociateModelMatrix (KFbxXMatrix &pMatrix) const |
Get matrix associated with the associate
model. |
|
void | SetTransformParentMatrix (const KFbxXMatrix &pMatrix) |
Set matrix associated with the parent node.
|
|
KFbxXMatrix & | GetTransformParentMatrix (KFbxXMatrix &pMatrix) const |
Get matrix associated with the parent node.
|
|
bool | IsTransformParentSet () const |
Get the Transform Parent set flag value.
|
|
User Data |
|
Service functions to
store and retrieve extra data about the link.Only used by the Maya
plugin, should move somewhere out of here... |
|
void | SetUserData (KString pUserDataID, KString pUserData) |
Set user data. |
|
KString | GetUserDataID () const |
Get the user data identifier. |
|
KString | GetUserData () const |
Get the user data. |
|
KString | GetUserData (KString pUserDataID) const |
Get the user data by identifier. |
enum ELinkMode |
Link modes.
The link mode sets how the link influences the position of a control point and the relationship between the weights assigned to a control point. The weights assigned to a control point are distributed among the set of links associated with an instance of class KFbxGeometry.
Definition at line 131 of file kfbxcluster.h.
{ eNORMALIZE, eADDITIVE, eTOTAL1 } ELinkMode;
KFbxCluster | ( | KFbxSdkManager & | pManager, |
char const * | pName | ||
) | [protected] |
ESubDeformerType GetSubDeformerType | ( | ) | const [inline, virtual] |
Get the type of the sub deformer.
Reimplemented from KFbxSubDeformer.
Definition at line 94 of file kfbxcluster.h.
{return eCLUSTER; };
void Reset | ( | ) |
Restore the cluster to its initial state.
Calling this function will clear the following:
void SetLinkMode | ( | ELinkMode | pMode | ) |
Set the link mode.
pMode | The link mode. |
ELinkMode GetLinkMode | ( | ) | const |
Get the link mode.
void SetLink | ( | KFbxNode const * | pNode | ) |
Set the link node.
The link node is the node which influences the displacement of the control points. Typically, the link node is the bone a skin is attached to.
pNode | The link node. |
KFbxNode* GetLink | ( | ) |
Get the link node.
The link node is the node which influences the displacement of the control points. Typically, the link node is the bone a skin is attached to.
NULL
if KFbxCluster::SetLink() has not been called
before.KFbxNode const* GetLink | ( | ) | const |
Get the link node (as const).
The link node is the node which influences the displacement of the control points. Typically, the link node is the bone a skin is attached to.
NULL
if KFbxCluster::SetLink() has not been called
before.void SetAssociateModel | ( | KFbxNode * | pNode | ) |
Set the associate model.
The associate model is optional. It is only relevant if the link mode is of type eADDITIVE. If set, the associate model is the node used as a reference to measure the relative displacement of the link node. Otherwise, the displacement of the link node is measured relative to the node containing the control points. Typically, the associate model node is the parent of the bone a skin is attached to.
pNode | The associate model node. |
KFbxNode* GetAssociateModel | ( | ) | const |
Get the associate model.
The associate model is optional. It is only relevant if the link mode is of type eADDITIVE. If set, the associate model is the node used as a reference to measure the relative displacement of the link node. Otherwise, the displacement of the link node is measured relative the the node containing the control points. Typically, the associate model node is the parent of the bone a skin is attached to.
NULL
if KFbxCluster::SetAssociateModel() has
not been called before.void AddControlPointIndex | ( | int | pIndex, |
double | pWeight | ||
) |
Add an element in both arrays of control point indices and weights.
pIndex | The index of the control point. |
pWeight | The link weight for this control point. |
int GetControlPointIndicesCount | ( | ) | const |
Get the length of the arrays of control point indices and weights.
int* GetControlPointIndices | ( | ) | const |
Get the array of control point indices.
NULL
if no control point indices have been added or
the array has been reset.double* GetControlPointWeights | ( | ) | const |
Get the array of control point weights.
NULL
if no control point indices have been added or
the array has been reset.void SetControlPointIWCount | ( | int | pCount | ) |
Set the array size for the three arrays: the array of control point indices, the array of weights and the array of blend weights.
pCount | The new count. |
void SetTransformMatrix | ( | const KFbxXMatrix & | pMatrix | ) |
Set matrix associated with the node containing the link.
pMatrix | Transformation matrix. |
KFbxXMatrix& GetTransformMatrix | ( | KFbxXMatrix & | pMatrix | ) | const |
Get matrix associated with the node containing the link.
pMatrix | Transformation matrix to be filled with appropriate data. |
void SetTransformLinkMatrix | ( | const KFbxXMatrix & | pMatrix | ) |
Set matrix associated with the link node.
pMatrix | Transformation matrix. |
KFbxXMatrix& GetTransformLinkMatrix | ( | KFbxXMatrix & | pMatrix | ) | const |
Get matrix associated with the link node.
pMatrix | Transformation matrix to be filled with appropriate data.. |
void SetTransformAssociateModelMatrix | ( | const KFbxXMatrix & | pMatrix | ) |
Set matrix associated with the associate model.
pMatrix | Transformation matrix. |
KFbxXMatrix& GetTransformAssociateModelMatrix | ( | KFbxXMatrix & | pMatrix | ) | const |
Get matrix associated with the associate model.
pMatrix | Transformation matrix to be filled with appropriate data.. |
void SetTransformParentMatrix | ( | const KFbxXMatrix & | pMatrix | ) |
Set matrix associated with the parent node.
pMatrix | Transformation matrix. |
KFbxXMatrix& GetTransformParentMatrix | ( | KFbxXMatrix & | pMatrix | ) | const |
Get matrix associated with the parent node.
pMatrix | Transformation matrix to be filled with appropriate data.. |
bool IsTransformParentSet | ( | ) | const [inline] |
Get the Transform Parent set flag value.
true
if transform matrix associated with parent
node is set.Definition at line 294 of file kfbxcluster.h.
{ return mIsTransformParentSet; }
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.
virtual void Construct | ( | const KFbxCluster * | pFrom | ) | [protected, virtual] |
virtual bool ConstructProperties | ( | bool | pForceSet | ) | [protected, virtual] |
Reimplemented from KFbxObject.
virtual KStringList GetTypeFlags | ( | ) | const [protected, virtual] |
Reimplemented from KFbxSubDeformer.
Set user data.
pUserDataID | Identifier of user data. |
pUserData | User data. |
KString GetUserDataID | ( | ) | const |
Get the user data identifier.
KString GetUserData | ( | ) | const |
Get the user data.
Get the user data by identifier.
friend class KFbxScene [friend] |
Reimplemented from KFbxSubDeformer.
Definition at line 367 of file kfbxcluster.h.
Definition at line 346 of file kfbxcluster.h.
KString mUserDataID
[protected] |
Definition at line 347 of file kfbxcluster.h.
Definition at line 348 of file kfbxcluster.h.
KArrayTemplate<int>
mControlPointIndices
[protected] |
Definition at line 349 of file kfbxcluster.h.
KArrayTemplate<double>
mControlPointWeights
[protected] |
Definition at line 350 of file kfbxcluster.h.
KFbxMatrix mTransform
[protected] |
Definition at line 351 of file kfbxcluster.h.
KFbxMatrix mTransformLink
[protected] |
Definition at line 352 of file kfbxcluster.h.
KFbxMatrix mTransformAssociate
[protected] |
Definition at line 353 of file kfbxcluster.h.
KFbxMatrix mTransformParent
[protected] |
Definition at line 354 of file kfbxcluster.h.
bool mIsTransformParentSet
[protected] |
Definition at line 355 of file kfbxcluster.h.
Definition at line 359 of file kfbxcluster.h.
Definition at line 360 of file kfbxcluster.h.
KFbxTypedProperty<fbxReference> SrcModel
[protected] |
Definition at line 364 of file kfbxcluster.h.
KFbxTypedProperty<fbxReference> SrcModelReference
[protected] |
Definition at line 365 of file kfbxcluster.h.