diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-05-18 21:30:59 +0200 |
---|---|---|
committer | Rémi Verschelde <remi@verschelde.fr> | 2016-05-18 21:30:59 +0200 |
commit | d7c9bb2565ceff2cff6d3cc9976810f5ab336040 (patch) | |
tree | d5bd15ceb5b877d1c432f597dbcfec292f51b1bf | |
parent | 926495d8eb11de2878319ba54f30812fa1637d72 (diff) | |
parent | f38473f65bd570467f485ca63af718454a70c546 (diff) |
Merge pull request #4707 from nounoursheureux/master
Check the save path before importing a 3D Mesh
-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 e628bed2dd..49d35220d4 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(TTR("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(TTR("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(); |