Loading all or part of an import file
 
 
 

You can import into an FBX scene all or only some of the data types that are stored in an import file. For example, you can choose whether or not to import the cameras, lights, animation, etc. These choices are called import options.

The following code snippet sets some import options:

// Import options determine what kind of data is to be imported.
// True is the default, but here we are setting import options explicitly.
IOSREF.SetBoolProp(IMP_FBX_MATERIAL,        true);
IOSREF.SetBoolProp(IMP_FBX_TEXTURE,         true);
IOSREF.SetBoolProp(IMP_FBX_LINK,            false);
IOSREF.SetBoolProp(IMP_FBX_SHAPE,           false);
IOSREF.SetBoolProp(IMP_FBX_GOBO,            false);
IOSREF.SetBoolProp(IMP_FBX_ANIMATION,       true);
IOSREF.SetBoolProp(IMP_FBX_GLOBAL_SETTINGS, true);

In the above snippet, IOSREF is a convenience macro:

#define IOSREF  KFbxIOSettings::IOSettingsRef()

Here is a call to import a file into the scene pscene:

lStatus = lImporter->Import(pScene); 

The importer reads the import file, extracts the scene data (as specified by the import options) from the file, and loads it into the FBX scene (which may or may not be previously empty). In other words, the FBX scene graph is populated with data extracted from the import file.

If the import file is not an FBX file, the importer does the necessary conversions to load it into an FBX scene.

In the ImportExport sample program, we load a scene from a file, but we do not look at the contents of the scene. For more detail on scenes, nodes, node attributes, etc., see Traversing the Scene Graph, which explains the SceneTreeView sample program.

Notes on import options: