Check the save path before importing a 3D Mesh

(cherry picked from commit f38473f65b)
This commit is contained in:
Wilhem Barbier 2016-05-18 20:26:07 +02:00 committed by Rémi Verschelde
parent 1d85dcb1fa
commit 16d38b199a
1 changed files with 9 additions and 9 deletions

View File

@ -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;
}
String file_path = dst.plus_file(meshes[i].get_file().basename()+".msh");
dst = dst.plus_file(meshes[i].get_file().basename()+".msh");
plugin->import(dst,imd);
plugin->import(file_path,imd);
}
hide();