From 945f40303abbefaacedff67415ceea02a793f7ca Mon Sep 17 00:00:00 2001 From: aswinmohanme Date: Fri, 16 Jun 2017 23:31:31 +0530 Subject: [PATCH] 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 --- editor/io_plugins/editor_mesh_import_plugin.cpp | 5 +++-- 1 file 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 91a4afbbf26..1ad829e9962 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 Refeof_reached()) - break; } if (l.begins_with("o ")) //name name = l.substr(2, l.length()).strip_edges(); + + if (f->eof_reached()) + break; } }