diff options
| author | Wilhem Barbier | 2016-05-18 20:26:07 +0200 |
|---|---|---|
| committer | Rémi Verschelde | 2016-06-04 22:20:02 +0200 |
| commit | 16d38b199a2a3b4ca74bd7acab3ad426218353ff (patch) | |
| tree | fbfeb00625a5e7413e4567a79f05e0dc2f8e3d43 /tools/editor | |
| parent | 1d85dcb1fa71bfc56705e219d176b8d58daf1725 (diff) | |
| download | godot-16d38b199a2a3b4ca74bd7acab3ad426218353ff.tar.gz godot-16d38b199a2a3b4ca74bd7acab3ad426218353ff.tar.zst godot-16d38b199a2a3b4ca74bd7acab3ad426218353ff.zip | |
Check the save path before importing a 3D Mesh
(cherry picked from commit f38473f65bd570467f485ca63af718454a70c546)
Diffstat (limited to 'tools/editor')
| -rw-r--r-- | tools/editor/io_plugins/editor_mesh_import_plugin.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp index b32ab8cb0..be93b5ab7 100644 --- a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp @@ -207,6 +207,13 @@ public: return; } + String dst = save_path->get_text(); + if (dst=="") { + error_dialog->set_text("Save path is empty!"); + error_dialog->popup_centered_minsize(); + return; + } + for(int i=0;i<meshes.size();i++) { Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata ); @@ -224,16 +231,9 @@ public: imd->add_source(EditorImportPlugin::validate_source_path(meshes[i])); - String dst = save_path->get_text(); - if (dst=="") { - error_dialog->set_text("Save path is empty!"); - error_dialog->popup_centered_minsize(); - return; - } - - dst = dst.plus_file(meshes[i].get_file().basename()+".msh"); + String file_path = dst.plus_file(meshes[i].get_file().basename()+".msh"); - plugin->import(dst,imd); + plugin->import(file_path,imd); } hide(); |
