From aa9dd6a14b84c4039c23e4464a7f55908859773b Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 28 Mar 2015 12:08:59 +0100 Subject: [PATCH] - check property name before setting up the primitive type for meshes. - fix lookup for vertex attribute type lookup. Signed-off-by: Kim Kulling --- code/OpenGEXImporter.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/OpenGEXImporter.cpp b/code/OpenGEXImporter.cpp index dc571efad..7188ce018 100644 --- a/code/OpenGEXImporter.cpp +++ b/code/OpenGEXImporter.cpp @@ -529,8 +529,10 @@ void OpenGEXImporter::handleMeshNode( ODDLParser::DDLNode *node, aiScene *pScene if( NULL != prop ) { std::string propName, propKey; propId2StdString( prop, propName, propKey ); - if( "triangles" == propName ) { - m_currentMesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE; + if( "primitive" == propName ) { + if( "triangles" == propKey ) { + m_currentMesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE; + } } } @@ -571,7 +573,7 @@ void OpenGEXImporter::handleVertexArrayNode( ODDLParser::DDLNode *node, aiScene if( NULL != prop ) { std::string propName, propKey; propId2StdString( prop, propName, propKey ); - MeshAttribute attribType( getAttributeByName( propName.c_str() ) ); + MeshAttribute attribType( getAttributeByName( propKey.c_str() ) ); if( None == attribType ) { return; }