Getting a reference to the root node of a scene
 
 
 

Here is a diagram showing an extremely simple scene containing a camera, a light, a ball, a hoop, and a stick figure of a basketball player. A tree must have a root node, which is an anchor point for the scene. It never represents anything “real” in the scene:

In FBX, a scene has exactly one root node. KFbxScene has a function calledGetRootNode()which returns a reference to the root node ofgScene, a global Scene object:

// to get the root node
const KFbxNode* GetRootNode()
{
	return gScene->GetRootNode();
}

Here is the diagram showing the scene object, the root node, and the other nodes. We’ve simplified the diagram by eliminating the player nodes:

Scene objects are instances of Class KFbxScene. Node objects are instances of Class KFbxNode.

NoteThe root node referenced by aKFBXSceneobject is not saved in an exported file.

So if you want, for example, to apply a global translation to all objects in the scene: create a second root node (named RootNodeGlobals, let’s say) below RootNode and above the BallNode, HoopNode, etc.; apply the translation to RootNodeGlobals.

RootNodeGlobals will be saved with the global translation properties.