The main logic
 
 
 

ImportExport’sImportExport()method contains the main logic of the file conversion program.ImportExport()does the following:

Source code for ImportExport()

void ImportExport(
 const char *ImportFileName,
 const char* ExportFileName,
 int pWriteFileFormat
 )
{
 // Create the SdkManager
 KFbxSdkManager* lSdkManager = KFbxSdkManager::CreateKFbxSdkManager();
 // Create the Scene
 KFbxScene* lScene = KFbxScene::Create(lSdkManager,"");
 // Initialize the KFbxSdkManager and the KFbxScene
 InitializeSdkObjects(lSdkManager, lScene);
 UI_Printf("------- Import started ---------------------------");
 // Load the scene.
 bool r = LoadScene(lSdkManager, lScene, ImportFileName);
 if(r)
 UI_Printf("------- Import succeeded -------------------------");
 else
 {
 UI_Printf("------- Import failed ----------------------------");
 DestroySdkObjects(lSdkManager);
 return;
 }
 UI_Printf("\r\n"); // add a blank line
 UI_Printf("------- Export started ---------------------------");
 // Save the scene.
 r = SaveScene(lSdkManager, // Use this manager...
 lScene, // to export this scene...
 ExportFileName, // to this path/filename...
 pWriteFileFormat, // using this file format.
 false); // Don't embed media files, if any.
 if(r) UI_Printf("------- Export succeeded -------------------------");
 else UI_Printf("------- Export failed ----------------------------");
 // Delete the FBX SDK manager.
 DestroySdkObjects(lSdkManager);
}