From c0a71da9e385ff3dfb0d32d4ada282330878da35 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Sat, 9 May 2015 13:16:34 -0700 Subject: [PATCH] Handle empty face groups, such as in the rama cyclinder that crashed the Friday meeting (http://headache.hungry.com/~seth/hifi/stickCollisionModel.obj). --- libraries/fbx/src/OBJReader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/fbx/src/OBJReader.cpp b/libraries/fbx/src/OBJReader.cpp index c26dcacd4c..4a8a2fc53d 100644 --- a/libraries/fbx/src/OBJReader.cpp +++ b/libraries/fbx/src/OBJReader.cpp @@ -386,8 +386,9 @@ bool OBJReader::parseOBJGroup(OBJTokenizer& tokenizer, const QVariantHash& mappi done: if (faces.count() == 0) { // empty mesh mesh.parts.pop_back(); + } else { + faceGroups.append(faces); // We're done with this group. Add the faces. } - faceGroups.append(faces); // We're done with this group. Add the faces. //qCDebug(modelformat) << "end group:" << meshPart.materialID << " original faces:" << originalFaceCountForDebugging << " triangles:" << faces.count() << " keep going:" << result; return result; }