From 52a7be775d82f8e738a336bc2eaca7a6d94c6511 Mon Sep 17 00:00:00 2001 From: Dunni <1390395+Dunni@users.noreply.github.com> Date: Mon, 6 Jan 2020 14:57:59 +0100 Subject: [PATCH] Fix PlyExporter to support faces with 0 vertices --- code/Ply/PlyExporter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/Ply/PlyExporter.cpp b/code/Ply/PlyExporter.cpp index 5e21a88ac..a7498983b 100644 --- a/code/Ply/PlyExporter.cpp +++ b/code/Ply/PlyExporter.cpp @@ -373,10 +373,11 @@ void PlyExporter::WriteMeshIndices(const aiMesh* m, unsigned int offset) { for (unsigned int i = 0; i < m->mNumFaces; ++i) { const aiFace& f = m->mFaces[i]; - mOutput << f.mNumIndices << " "; + mOutput << f.mNumIndices; for(unsigned int c = 0; c < f.mNumIndices; ++c) { - mOutput << (f.mIndices[c] + offset) << (c == f.mNumIndices-1 ? endl : " "); + mOutput << " " << (f.mIndices[c] + offset); } + mOutput << endl; } }