【发布时间】:2015-10-30 06:33:52
【问题描述】:
我遇到了 FbxImporter 无法初始化的问题。当我调用 GetStatus.GetErrorString() 时它返回的 ErrorString 是“意外的文件类型”。状态的错误代码是 EFailure(在查看了所有 Autodesk 所说的是否意味着它失败后)。我尝试了许多不同的 fbx 文件,但它们似乎都不起作用。此外,我已将它们包含在 Visual Studio 项目中,甚至包含可执行文件(我知道这不是原因,因为其他文件加载得很好)。环顾四周,确实没有论坛帖子或任何可以帮助我解决问题的东西。
这是我的进口商代码的 sn-p。
//set up the fbxmanager
FbxManager* fbxManager = FbxManager::Create();
//set the settings for the manager
FbxIOSettings* ioSettings = FbxIOSettings::Create(fbxManager, IOSROOT);
fbxManager->SetIOSettings(ioSettings);
//set the settings for the fbx io settings
//create and init the importer
FbxImporter *importer = FbxImporter::Create(fbxManager,"");
//create and init the scene
FbxScene* fbxScene = FbxScene::Create(fbxManager, "");
//init the importer
result = importer->Initialize(filename,-1, fbxManager->GetIOSettings());
if (!result)
{
string error = importer->GetStatus().GetErrorString();
FbxStatus status = importer->GetStatus().GetCode();
return false;
}
如果我需要澄清问题或者您需要更多信息来回答我的问题,请说出来,谢谢。
【问题讨论】:
-
您使用的是 WinRT API 吗?我在通用应用项目中使用它时遇到了同样的问题。
-
不,我没有使用通用应用程序项目或 winRT api。只是 win api 和 dx 11_0