Brief sample programs
 
 
 

The FBX SDK ships with the following sample programs that run on all platforms supported by FBX SDK.

Brief sample program Description
Common Functions used by other sample programs to initializing objects, destroying objects, loading scenes, and saving scenes.
MyOwnWriterReader Functions used by other sample programs to write and read files in a custom file format.
Animation Shows how to create animation and how to evaluate a scene containg animation. Illustrates the use of animation stacks, animation layers, animation curves and animation curve nodes.
ExportScene01 Creates and exports an animated scene containing a cylinder deformed by a skeleton made of two segments.
ExportScene02 Creates and exports an animated scene containing a sphere morphed by two shapes.
ExportScene03 Creates and exports an animated scene containing a textured cube, and a pyramid with materials mapped on its faces.
ExportScene04 Creates and exports a scene containing a group of lights, a marker, and a camera. The animation rotates the lights and moves the camera.
ExportScene05 In FBX, the position of a node is expressed in coordinates relative to the node’s parent. This example shows how to convert between FBX coordinates and a global coordinate system.
ImportScene Displays the content of any FBX file.
Layers Creates a scene containing a cube with layered textures and materials mapped on each of the cube’s faces. Illustrates how to use layers.
UserProperties Illustrates how to create user properties, attach the properties to a cube, and then animate the properties; how to create a constraint between a pyramid and a cube.
ViewScene Shows how to evaluate the animation data and compute deformations. This is necessary for displaying the content of any FBX SDK-supported file in a graphical window.Uses the OpenGL Utility Toolkit (GLUT). A menu lets you select the view, the current camera, the current animation stack, etc.

Folders for each of these programs are located in <yourFBXSDKpath>\examples\. Each folder contains Visual Studio project files (Windows only) or makefiles (Mac OS or Linux) to help you build and run the program.

Common

The Common folder does not contain a standalone example.

It contains a common.cxx file, which shows how to use FBX SDK to perform basic operations such as creating and initializing scenes, destroying scenes, loading scenes, and saving scenes. The other sample programs call the functions defined in this file.

Animation

This sample program creates a scene containing only one property a few animation curves, and the data structures that animates the property by connecting the curves to the property. The program then shows how to evaluate the scene using KFbxEvaluator.

This sample program illustrates:

MyOwnWriterReader

This sample code shows how to use FBX SDK to write and read files in a custom file format, i.e., a file format not directly supported by FBX SDK. The sample code reads and writes “CustomWriter” files.

The MyOwnWriterReader folder does not contain a standalone sample program. Instead, it contains sample functions that support CustomWriter files. The sample functions are in turn used by other sample programs (ExportScene05, ImportScene, and ViewScene) to write and read CustomWriter files.

For more information, see Supporting additional file formats.

ExportScene01

The scene created in this example is a cylinder linked to a skeleton made of two segments. Two animation stacks of animation show the influence of the skeleton segments over the cylinder. ExportScene01 illustrates how to:

ExportScene02

The scene created in this example is a sphere morphed by two shapes. A animation stack of animation shows the influence of the shapes over the sphere. ExportScene02 illustrates how to:

ExportScene03

The scene created in this example is a textured cube and a pyramid with materials mapped on its faces. The animation displays six different angles of both models. ExportScene03 illustrates how to:

ExportScene04

The scene created in this example contains a group of lights, a marker, and a camera. Animation rotates the lights and moves the camera. ExportScene04 illustrates how to:

ExportScene05

The scene created in this example contains a skeleton made of three segments. The position of a node in an .fbx file is expressed in coordinates relative to its parent. This example shows how to convert to and from a global position. ExportScene05 illustrates how to:

ImportScene

This example illustrates how to detect if a scene is password protected, and how to import and browse the scene to access node and animation information. This example displays the content of an .fbx file that is passed as program argument. It shows how to traverse an FBX scene graph and retrieve its content. You can try this example using any of the FBX SDK-supported files output by the export examples.

Layers

In this example, a scene is created containing a cube with layered textures and materials mapped on each of the cube’s faces. This example illustrates how to use texture layers. (Note: Texture layers are not the same as animation layers.)

UserProperties

In this example, a scene is created containing a cube, a pyramid, and user properties. This example illustrates how to:

NoteUser properties are also called custom properties.

ViewScene

This example illustrates how to display the content of an .fbx or .obj file in a graphical window. This program is based on the OpenGL® Utility Toolkit (GLUT). Start the program on the command line by providing the name of any FBX SDK-supported file. A menu opens letting you select the current camera and the current animation stack. The ViewScene example illustrates how to: