Getting the properties of a node as a point in space
 
 
 

A node represents a point in space. The properties of KFbxNode include those of the node’s translation, rotation, and scaling (TRS). There are also properties that define limits on the TRS properties.

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

Properties that are generic to any point in space belong to KFbxNode.

SceneTreeView displays, for each node:

A node such as RootNode is an exception. It is simply a reference point in the tree: it doesn’t represent a point in space.

Let’s examine the code for getting a node’s location.

Since location is expressed as a translation from the parent node’s location, we need to get the translation values. More precisely, we are getting the default translation values: the 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 Tutorial 3: Adding Textures, Materials, and Animation.

// to get a string from the node default translation values
KString GetDefaultTranslationInfo(
                                  const KFbxNode* pNode
                                  )
{
    KFbxVector4 v4;
    ((KFbxNode*)pNode)->GetDefaultT(v4);
    return KString("Translation (X,Y,Z): ") + KString(v4.GetAt(0)) + ", " + 
        KString(v4.GetAt(1)) + ", " + KString(v4.GetAt(2));
}
// to get a string from the node visibility value
KString GetNodeVisibility(
                          const KFbxNode* pNode
                          )
{
    return KString("Visibility: ") + (pNode->GetVisibility() ? "Yes":"No");
}