PlyLoader: fix vertex attribute lookup.

pull/1378/head
Kim Kulling 2017-08-02 14:24:53 +02:00
parent 81fd027860
commit 8478df7dbd
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}