Creating a scene and getting its root node
 
 
 

FBX applications using create the scene object immediately after creating the SDK Manager object:

// Declarations
KFbxSdkManager* mySdkManager = NULL;
KFbxScene*      myScene      = NULL;
const KFbxNode* myRootNode   = NULL;
...
// Create SDK manager to manage memory
mySdkManager = KFbxSdkManager::Create();
 
// Create scene object
myScene = KFbxScene::Create(gSdkManager, "");

In FBX, a scene has exactly one root node. KFbxScene has a function GetRootNode() which returns a reference to the root node of a scene:

//Get the scene’s root node
KFbxNode* rootNode = myScene->GetRootNode();

All nodes in an FBX scene graph are, directly or indirectly, children of the root node:

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

The root node referenced by a KFBXScene object is not saved in an export file. So if you want, for example, to apply a global translation to all objects in the scene:

  1. Create a node (named, for example, RootNodeForGlobals) below RootNode and above the BallNode, HoopNode, etc.
  2. Apply the global translation to RootNodeForGlobals.

RootNodeForGlobals will be saved in the export file with the global translation properties.