diff options
Diffstat (limited to 'editor/editor_file_system.cpp')
-rw-r--r-- | editor/editor_file_system.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index bff090cdbc..dca32d7492 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -27,6 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ + #include "editor_file_system.h" #include "editor_node.h" @@ -1508,6 +1509,19 @@ void EditorFileSystem::_reimport_file(const String &p_file) { void EditorFileSystem::reimport_files(const Vector<String> &p_files) { + { //check that .import folder exists + DirAccess *da = DirAccess::open("res://"); + if (da->change_dir(".import") != OK) { + Error err = da->make_dir(".import"); + if (err) { + memdelete(da); + ERR_EXPLAIN("Failed to create 'res://.import' folder."); + ERR_FAIL_COND(err != OK); + } + } + memdelete(da); + } + importing = true; EditorProgress pr("reimport", TTR("(Re)Importing Assets"), p_files.size()); |