From 799ae75d67cc8459bc0bf87e6a446829ecc87e04 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 29 May 2011 20:38:46 +0000 Subject: [PATCH] # Obj: add missing check for empty normals, which caused models with no or partial normal sets to fail in some cases. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1010 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/ObjFileImporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ObjFileImporter.cpp b/code/ObjFileImporter.cpp index a3610c7b9..864ed4fff 100644 --- a/code/ObjFileImporter.cpp +++ b/code/ObjFileImporter.cpp @@ -342,7 +342,7 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel, pMesh->mVertices[ newIndex ] = pModel->m_Vertices[ vertex ]; // Copy all normals - if ( !pSourceFace->m_pNormals->empty() ) + if ( !pSourceFace->m_pNormals->empty() && !pModel->m_Normals.empty()) { const unsigned int normal = pSourceFace->m_pNormals->at( vertexIndex ); if (normal >= pModel->m_Normals.size()) {