首页 > 解决方案 > Assimp 5.0.0 在导出时崩溃

问题描述

我正在尝试导出我的 aiScene(与 assimp 4.1.0 一起正常工作),每次程序结束并调用它的导出函数时,我都会崩溃。我将 aiScene 子类化,构造函数如下所示:

customAiScene::customAiScene()
{
    mFlags = 0;
    mRootNode = NULL;
    mNumMeshes = 0;
    mMeshes = NULL;
    mNumMaterials = 0;
    mMaterials = NULL;
    mNumAnimations = 0;
    mAnimations = NULL;
    mNumTextures = 0;
    mTextures = NULL;
    mNumLights = 0;
    mLights = NULL;
    mNumCameras = 0;
    mCameras = NULL;
    mPrivate = NULL;
    exporter = new Assimp::Exporter();
    int n = exporter->GetExportFormatCount();
    for (int i = 0; i < n; i++) {
        const aiExportFormatDesc* formatDescription = exporter->GetExportFormatDescription(i);
        wxString sDesc = wxString::FromUTF8(formatDescription->description);
        wxString sExt = wxString::FromUTF8(formatDescription->fileExtension);
        wxString sID = wxString::FromUTF8(formatDescription->id);
        MyApp::showMessage(wxString::Format(wxT("export format: %s,%s,%s"), sDesc, sExt, sID), "l");
    }
}

稍后,设置数据后,我导出场景:

exporter->Export(this, exportFormatDesc, filePath);

正如我所说,使用 assimp 4.1.0 它可以正常工作(但我需要 FBX 导出,因此是新版本的原因)。谢谢你的帮助。

标签: assimpexporter

解决方案


我会和我们现在的主人一起检查你的代码。这似乎是一个错误。

我打开了问题报告https://github.com/assimp/assimp/issues/2846来跟踪您的问题。


推荐阅读