Tutorial: SceneTreeView
 
 
 

Shows how to traverse all the nodes in an FBX scene, and how to determine the content of each node, i.e., whether a node contains a camera, a light, a mesh, etc. For more information, see Nodes and the Scene Graph.

Operations include:

NoteBuilds and runs on Windows only.

Project Organization

The SceneTreeView project is located at <yourFBXSDKpath>\examples\UI Examples\SceneTreeView\.

SceneTreeView has two source files:

Source file Description
SDK_Utility.cxx Contains platform-independent code that calls FBX SDK to create the scene, import the file, retrieve data from each node in the scene graph, and add materials, textures, and animation to the cubes. This tutorial explains much of the code in this file.
UI.cxx Contains the code that interacts with the user and with Windows, and traverses the scene graph to display the tree view of the scene. The code contains some calls to FBX SDK.

User Interface

The SceneTreeView sample program imports an FBX file into an empty scene, then displays the scene graph. The scene graph is more precisely a tree, also called a node hierarchy.

The nodes of the tree refer to the scene elements—the cameras, lights, meshes, skeletons, NURBS, and so forth—that were imported from the FBX file. To display this tree, SceneTreeView must traverse the entire tree, that is, it must visit each node.

Main Logic

SceneTreeView logic:

Starting with the root node, SceneTreeView traverses the tree recursively. At each node, SceneTreeView: