Prevent Editor from hang when importing stl as mesh

When Importing an stl file into Godot from the import mesh menu, the
editor hangs indefinitely. Since only Obj files are supported, the data
remains unparsed and hence the editor enters an infinte loop.

This commit fixes this issue by exiting the loop when godot has finished
parsing the file, irrespective of whether any meaningful data was
extracted out.

Fixes: #9200
This commit is contained in:
aswinmohanme 2017-06-16 23:31:31 +05:30 committed by Rémi Verschelde
parent e17966ca01
commit 945f40303a

View file

@ -513,12 +513,13 @@ Error EditorMeshImportPlugin::import(const String &p_path, const Ref<ResourceImp
has_index_data = false;
if (f->eof_reached())
break;
}
if (l.begins_with("o ")) //name
name = l.substr(2, l.length()).strip_edges();
if (f->eof_reached())
break;
}
}