示例#1
0
int main (int argc, char** argv) {

    FbxManager* fbxManager = NULL;
    FbxScene* lScene = NULL;

    // Prepare the FBX SDK.
    InitializeSdkObjects(fbxManager);

	std::vector<std::string> fileNamesForImport = GetFbxFileNamesForImport();
	bool EXPORT_ALL_TO_ONE_FOLDER = true;

	for (unsigned int i = 0; i < fileNamesForImport.size(); ++i) {

		std::string fbxFileName = fileNamesForImport[i];

		Scene* scene = ParseScene(fbxManager, IMPORT_PATH + fbxFileName);

		scene->DEBUG_ExportNamesOfAllObjectsInScene();

		if (!EXPORT_ALL_TO_ONE_FOLDER) {
			std::string exportFolderName = fbxFileName.substr(0, fbxFileName.find("."));
			FileUtilities::CreateFolder(EXPORT_PATH_BASE + exportFolderName);
			FileUtilities::CreateFolder(EXPORT_PATH_BASE + exportFolderName + "/" EXPORT_FOLDER_MODELS);
			FileUtilities::CreateFolder(EXPORT_PATH_BASE + exportFolderName + "/" EXPORT_FOLDER_ANIMCLIPS);
			ExportSceneToModelFiles(scene, EXPORT_PATH_BASE + exportFolderName + "/");

		} else {
			FileUtilities::CreateFolder(EXPORT_PATH_BASE);
			FileUtilities::CreateFolder(EXPORT_PATH_BASE EXPORT_FOLDER_MODELS);
			FileUtilities::CreateFolder(EXPORT_PATH_BASE EXPORT_FOLDER_ANIMCLIPS);
			ExportSceneToModelFiles(scene, EXPORT_PATH_BASE);
		}
	}

    //Destroy all objects created by the FBX SDK.
    DestroySdkObjects(fbxManager, true);

	std::cin.get();
    return 0;
}