Преглед изворни кода

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
aswinmohanme пре 8 година
родитељ
комит
945f40303a
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      editor/io_plugins/editor_mesh_import_plugin.cpp

+ 3 - 2
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;
 		}
 	}