Obj loader ignores empty meshes now. Thanks for tomva for the patch (see http://sourceforge.net/projects/assimp/forums/forum/817654/topic/3402881).
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@487 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/1/head
parent
35b7416437
commit
8b19981ce9
|
@ -188,8 +188,10 @@ aiNode *ObjFileImporter::createNodes(const ObjFile::Model* pModel, const ObjFile
|
||||||
for (unsigned int meshIndex = 0; meshIndex < pModel->m_Meshes.size(); meshIndex++)
|
for (unsigned int meshIndex = 0; meshIndex < pModel->m_Meshes.size(); meshIndex++)
|
||||||
{
|
{
|
||||||
pMesh = new aiMesh();
|
pMesh = new aiMesh();
|
||||||
MeshArray.push_back( pMesh );
|
|
||||||
createTopology( pModel, pData, meshIndex, pMesh );
|
createTopology( pModel, pData, meshIndex, pMesh );
|
||||||
|
if (pMesh->mNumVertices > 0) {
|
||||||
|
MeshArray.push_back( pMesh );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create all nodes from the subobjects stored in the current object
|
// Create all nodes from the subobjects stored in the current object
|
||||||
|
@ -299,7 +301,7 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel,
|
||||||
|
|
||||||
// Get current mesh
|
// Get current mesh
|
||||||
ObjFile::Mesh *pObjMesh = pModel->m_Meshes[ uiMeshIndex ];
|
ObjFile::Mesh *pObjMesh = pModel->m_Meshes[ uiMeshIndex ];
|
||||||
if ( NULL == pObjMesh )
|
if ( NULL == pObjMesh || pObjMesh->m_uiNumIndices < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Copy vertices of this mesh instance
|
// Copy vertices of this mesh instance
|
||||||
|
|
Loading…
Reference in New Issue