Merge pull request #4707 from nounoursheureux/master
Check the save path before importing a 3D Mesh
This commit is contained in:
commit
d7c9bb2565
1 changed files with 9 additions and 9 deletions
|
@ -207,6 +207,13 @@ public:
|
||||||
return;
|
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++) {
|
for(int i=0;i<meshes.size();i++) {
|
||||||
|
|
||||||
Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata );
|
Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata );
|
||||||
|
@ -224,16 +231,9 @@ public:
|
||||||
|
|
||||||
imd->add_source(EditorImportPlugin::validate_source_path(meshes[i]));
|
imd->add_source(EditorImportPlugin::validate_source_path(meshes[i]));
|
||||||
|
|
||||||
String dst = save_path->get_text();
|
String file_path = dst.plus_file(meshes[i].get_file().basename()+".msh");
|
||||||
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");
|
plugin->import(file_path,imd);
|
||||||
|
|
||||||
plugin->import(dst,imd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hide();
|
hide();
|
||||||
|
|
Loading…
Reference in a new issue