소스 검색

- fbx: warn about empty meshes and ignore them.

Alexander Gessler 13 년 전
부모
커밋
e945998fc8
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      code/FBXDocument.cpp

+ 10 - 0
code/FBXDocument.cpp

@@ -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);