From f053695176517da997fdb549f65bcc741112d786 Mon Sep 17 00:00:00 2001 From: Alexandre Avenel Date: Sat, 3 Mar 2018 16:56:48 +0100 Subject: [PATCH] Fix issue #623 PLY importer should not create faces When the PLY file contains no faces, we should not create them. --- code/PlyLoader.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/code/PlyLoader.cpp b/code/PlyLoader.cpp index 5f4e556c1..88be670cc 100644 --- a/code/PlyLoader.cpp +++ b/code/PlyLoader.cpp @@ -244,30 +244,6 @@ void PLYImporter::InternReadFile(const std::string& pFile, aiScene* pScene, IOSy // if no face list is existing we assume that the vertex // list is containing a list of points bool pointsOnly = mGeneratedMesh->mFaces == NULL ? true : false; - if (pointsOnly) { - if (mGeneratedMesh->mNumVertices < 3) { - if (mGeneratedMesh != NULL) { - delete(mGeneratedMesh); - mGeneratedMesh = nullptr; - } - - streamedBuffer.close(); - throw DeadlyImportError("Invalid .ply file: Not enough " - "vertices to build a proper face list. "); - } - - const unsigned int iNum = (unsigned int)mGeneratedMesh->mNumVertices / 3; - mGeneratedMesh->mNumFaces = iNum; - mGeneratedMesh->mFaces = new aiFace[mGeneratedMesh->mNumFaces]; - - for (unsigned int i = 0; i < iNum; ++i) { - mGeneratedMesh->mFaces[i].mNumIndices = 3; - mGeneratedMesh->mFaces[i].mIndices = new unsigned int[3]; - mGeneratedMesh->mFaces[i].mIndices[0] = (i * 3); - mGeneratedMesh->mFaces[i].mIndices[1] = (i * 3) + 1; - mGeneratedMesh->mFaces[i].mIndices[2] = (i * 3) + 2; - } - } // now load a list of all materials std::vector avMaterials;