From 8478df7dbd19949cafb6b9c4d60be6f0abe1475a Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 2 Aug 2017 14:24:53 +0200 Subject: [PATCH] PlyLoader: fix vertex attribute lookup. --- code/PlyLoader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/PlyLoader.cpp b/code/PlyLoader.cpp index 937e839f5..b9af10c0e 100644 --- a/code/PlyLoader.cpp +++ b/code/PlyLoader.cpp @@ -513,7 +513,7 @@ void PLYImporter::LoadVertex(const PLY::Element* pcElement, const PLY::ElementIn mGeneratedMesh->mMaterialIndex = 0; } - if (mGeneratedMesh->mVertices == NULL) + if (mGeneratedMesh->HasPositions() ) { mGeneratedMesh->mNumVertices = pcElement->NumOccur; mGeneratedMesh->mVertices = new aiVector3D[mGeneratedMesh->mNumVertices]; @@ -523,14 +523,14 @@ void PLYImporter::LoadVertex(const PLY::Element* pcElement, const PLY::ElementIn if (haveNormal) { - if (mGeneratedMesh->mNormals == NULL) + if (mGeneratedMesh->HasNormals() ) mGeneratedMesh->mNormals = new aiVector3D[mGeneratedMesh->mNumVertices]; mGeneratedMesh->mNormals[pos] = nOut; } if (haveColor) { - if (mGeneratedMesh->mColors[0] == NULL) + if (mGeneratedMesh->HasVertexColors( 0 ) ) mGeneratedMesh->mColors[0] = new aiColor4D[mGeneratedMesh->mNumVertices]; mGeneratedMesh->mColors[0][pos] = cOut; }