- fbx: warn about empty meshes and ignore them.

pull/14/head
Alexander Gessler 2012-06-28 19:23:08 +02:00
parent d61c86081c
commit e945998fc8
1 changed files with 10 additions and 0 deletions

View File

@ -412,9 +412,19 @@ MeshGeometry::MeshGeometry(const Element& element, const std::string& name, cons
std::vector<aiVector3D> tempVerts;
ReadVectorDataArray(tempVerts,Vertices);
if(tempVerts.empty()) {
FBXImporter::LogWarn("encountered mesh with no vertices");
return;
}
std::vector<int> tempFaces;
ReadVectorDataArray(tempFaces,PolygonVertexIndex);
if(tempFaces.empty()) {
FBXImporter::LogWarn("encountered mesh with no faces");
return;
}
vertices.reserve(tempFaces.size());
faces.reserve(tempFaces.size() / 3);