From e945998fc8689fac1f5ea657661fe0693c9ef539 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Thu, 28 Jun 2012 19:23:08 +0200 Subject: [PATCH] - fbx: warn about empty meshes and ignore them. --- code/FBXDocument.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/FBXDocument.cpp b/code/FBXDocument.cpp index b007ad4bd..549c8e34c 100644 --- a/code/FBXDocument.cpp +++ b/code/FBXDocument.cpp @@ -412,9 +412,19 @@ MeshGeometry::MeshGeometry(const Element& element, const std::string& name, cons std::vector tempVerts; ReadVectorDataArray(tempVerts,Vertices); + if(tempVerts.empty()) { + FBXImporter::LogWarn("encountered mesh with no vertices"); + return; + } + std::vector tempFaces; ReadVectorDataArray(tempFaces,PolygonVertexIndex); + if(tempFaces.empty()) { + FBXImporter::LogWarn("encountered mesh with no faces"); + return; + } + vertices.reserve(tempFaces.size()); faces.reserve(tempFaces.size() / 3);