Commit 2f858e23 authored by Mike Kremer's avatar Mike Kremer
Browse files

OBJ-Reader now adds empty meshes if file is empty.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11989 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 04fa25b7
......@@ -1413,10 +1413,15 @@ void FileOBJPlugin::checkTypes(QString _filename, OBJImporter& _importer, QStrin
}
if (faceCount > 0){
if(faceCount > 0) {
if ( options & OBJImporter::TRIMESH ) TriMeshCount++;
if ( options & OBJImporter::POLYMESH ) PolyMeshCount++;
_importer.setObjectOptions( options );
} else {
// Mesh does not contain any faces
PolyMeshCount++;
_importer.setObjectOptions(OBJImporter::TRIMESH);
std::cerr << "Adding a polymesh" << std::endl;
}
if (TriMeshCount == 0 && PolyMeshCount == 0)
......
......@@ -214,6 +214,8 @@ void OBJImporter::addUsedVertices(int _groupId) {
// add all vertices to the mesh
if(usedVertices_.size() <= (unsigned int)_groupId) return;
for (std::set<VertexHandle>::iterator it = usedVertices_[_groupId].begin(); it != usedVertices_[_groupId].end(); it++) {
if (*it >= (int) vertices_.size()) {
......@@ -235,6 +237,8 @@ void OBJImporter::addUsedVertices(int _groupId) {
//add all vertices to the mesh
if(usedVertices_.size() <= (unsigned int)currentObject()) return;
for (std::set<VertexHandle>::iterator it = usedVertices_[currentObject()].begin(); it
!= usedVertices_[currentObject()].end(); it++) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment