Przeglądaj źródła

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 lat temu
rodzic
commit
945f40303a

+ 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;
 				has_index_data = false;
 
 
-				if (f->eof_reached())
-					break;
 			}
 			}
 
 
 			if (l.begins_with("o ")) //name
 			if (l.begins_with("o ")) //name
 				name = l.substr(2, l.length()).strip_edges();
 				name = l.substr(2, l.length()).strip_edges();
+
+			if (f->eof_reached())
+				break;
 		}
 		}
 	}
 	}