Getting the properties of a node as a point in space
 
 
 

A node represents a point in space. Properties that are generic to any point in space are generally accessed using class KFbxNode. The properties of KFbxNode include those of the node’s translation, rotation, and scaling (the TRS properties)

TRS properties are usually expressed as values of X, Y, and Z. These three values are usually stored in a vector of four elements, i.e., as KFbxVector4 objects.

NoteThe TRS properties of a node are expressed as offsets to the TRS properties of the node’s parent, which in turn are expressed as offsets of its parent’s TRS properties, and so on.

Since the location of an FBX node is expressed as a translation from the parent node’s location, we need to get those translation values. More precisely, we need to get the node’s default translation values.

NoteA node’s actual location may be affected by limits on the X, Y, and Z values, by constraints, and by animation curves (FCurves). These are discussed in Applying Textures and Materials to Meshes.

In FBX SDK, a triplet of X, Y, and Z values are often stored in a four-element vector, an instance of class KFbxVector4. Here is a function that shows how to get the default translation vector and how to access the X, Y, and Z values:

// Return a node’s default translation values as a text string
KString GetDefaultTranslationInfo(
                                  const KFbxNode* pNode
                                  )
{
    KFbxVector4 v4; // Default translation values
    v4 = ((KFbxNode*)pNode)->LclTranslation.Get();
 
    return KString("Translation (X,Y,Z): ") + KString(v4.GetAt(0)) + ", " + 
        KString(v4.GetAt(1)) + ", " + KString(v4.GetAt(2));
}