aboutsummaryrefslogtreecommitdiff
path: root/editor/io_plugins/editor_mesh_import_plugin.cpp
diff options
context:
space:
mode:
authoraswinmohanme2017-06-16 23:31:31 +0530
committerRémi Verschelde2017-06-17 12:55:46 +0200
commit945f40303abbefaacedff67415ceea02a793f7ca (patch)
tree0939c64e9542f44bd92a6fc9985eeb35217a99cc /editor/io_plugins/editor_mesh_import_plugin.cpp
parente17966ca017086d337968636396086b9d148ab52 (diff)
downloadgodot-945f40303abbefaacedff67415ceea02a793f7ca.tar.gz
godot-945f40303abbefaacedff67415ceea02a793f7ca.tar.zst
godot-945f40303abbefaacedff67415ceea02a793f7ca.zip
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
Diffstat (limited to 'editor/io_plugins/editor_mesh_import_plugin.cpp')
-rw-r--r--editor/io_plugins/editor_mesh_import_plugin.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/io_plugins/editor_mesh_import_plugin.cpp b/editor/io_plugins/editor_mesh_import_plugin.cpp
index 91a4afbbf..1ad829e99 100644
--- a/editor/io_plugins/editor_mesh_import_plugin.cpp
+++ b/editor/io_plugins/editor_mesh_import_plugin.cpp
@@ -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;
}
}