An Import Example
Importing a scene using the FBX importer is extremely simple. The example below illustrates this:
bool do_merge = false;
bool did_succeed = fbx_translator.
importScene(
"test.fbx", do_merge, &import_options, &type_filter);
See FBX_ImportOptions and FBX_ObjectTypeFilter for documentation on setting various import options and importing only specific types of primitives such as lights or animation from FBX files.
Any errors or warnings produced by the importer can be retrieved as following:
{
severity = UI_ERROR;
else
severity = UI_WARNING;
SIopenMessageDialog(msg, severity);
}
An Export Example
An example below illustrates the export of the current scene to an FBX file. Note that FBX is capable of containing entire scenes, including cameras, animation, lights, and skinning, instead of supporting only the geometry.
ROP_FBXExporterWrapper fbx_exporter;
ROP_FBXExportOptions export_options;
did_succeed = fbx_exporter.initializeExport("test_out.fbx", start_time, end_time, &export_options);
if(!did_succeed)
fbx_exporter.getErrorManager()->addError("Could not initialize FBX exporter", true);
else
{
fbx_exporter.doExport();
did_succeed = fbx_exporter.finishExport();
if(!did_succeed)
fbx_exporter.getErrorManager()->addError("Could not finalize FBX export", true);
}
See ROP_FBXExportOptions for more information on possible export options.