损坏的FBX二进制文件

时间:2018-12-25 02:21:46

标签: c++ fbx

我是使用FBX SDK的新手,我正在尝试将OBJ文件转换为C ++中的FBX ASCII文件。但是,运行以下代码时,它会输出Binary FBX文件,并且该文件似乎不正确/“已损坏”。我说它已损坏的原因是,当我将其插入Autodesk提供的FBX转换程序时,它表示从程序中获得的输入二进制文件已损坏。谁能帮我解决这个问题?先感谢您。

//Creates a SDK manager
FbxManager* fbxmanager = FbxManager::Create();

//Set the Input/Output Settings for the SDK Manager
//EXP_ = export settings; IMP_ = import setting 
FbxIOSettings* ios_settings = FbxIOSettings::Create(fbxmanager, IOSROOT);
ios_settings->SetBoolProp(EXP_ASCIIFBX, true);
fbxmanager->SetIOSettings(ios_settings);

//Creates a Scene
FbxScene* fbxscene = FbxScene::Create(fbxmanager, "");

//Creates an importer object
FbxImporter* fbximporter = FbxImporter::Create(fbxmanager, "");

//Path to the obj file
const char* obj_path = "objs/airboat.obj";

//Path to the saved fbx file
const char* fbx_path = "fbxs/global_mesh.fbx";

//Initilaize the Importer Object with the path and name of the file
bool import_stat = fbximporter->Initialize(obj_path, -1, fbxmanager->GetIOSettings());

import_stat = fbximporter->Import(fbxscene);

//Creates an exporter object
FbxExporter* fbxexporter = FbxExporter::Create(fbxmanager, "");

//Initilaize the Exporter Object with the path and name of the file

bool export_stat = fbxexporter->Initialize(fbx_path, -1,fbxmanager->GetIOSettings());

export_stat = fbxexporter->Export(fbxscene);

编辑:对不起,忘记提供调试输出:

所有布尔函数均得出true。

0 个答案:

没有答案