Merge branch 'master' into UnitTest_X3D

This commit is contained in:
Kim Kulling
2017-11-05 18:10:10 +01:00
committed by GitHub
3 changed files with 39 additions and 1 deletions

View File

@@ -383,7 +383,7 @@ void ObjExporter::AddMesh(const aiString& name, const aiMesh* m, const aiMatrix4
mMeshes.push_back(MeshInstance());
MeshInstance& mesh = mMeshes.back();
mesh.name = std::string(name.data,name.length) + (m->mName.length ? "_" + std::string(m->mName.data,m->mName.length) : "");
mesh.name = std::string( name.data, name.length );
mesh.matname = GetMaterialName(m->mMaterialIndex);
mesh.faces.resize(m->mNumFaces);

View File

@@ -477,6 +477,9 @@ void ObjFileParser::getFace( aiPrimitiveType type ) {
}
} else {
//On error, std::atoi will return 0 which is not a valid value
delete face;
delete m_pModel;
m_pModel = nullptr;
throw DeadlyImportError("OBJ: Invalid face indice");
}