The main logic
 
 
 

ImportExport’s ImportExport() 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 a scene
    KFbxScene* lScene = KFbxScene::Create(gSdkManager,"");
 
    UI_Printf("------- Import started ---------------------------");
 
    // Load the scene.
    bool r = LoadScene(gSdkManager, lScene, ImportFileName);
    if(r)
        UI_Printf("------- Import succeeded -------------------------");
    else
    {
        UI_Printf("------- Import failed ----------------------------");
 
        // Destroy the scene
        lScene->Destroy();
        return;
    }
 
    UI_Printf("\r\n"); // add a blank line
 
    UI_Printf("------- Export started ---------------------------");
 
    // Save the scene.
    r = SaveScene(gSdkManager, 
        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 ----------------------------");
 
     // destroy the scene
     lScene->Destroy();
}