summaryrefslogtreecommitdiffstats
path: root/editor/editor_file_system.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_file_system.cpp')
-rw-r--r--editor/editor_file_system.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 558eed98c6..0c284feb37 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -1259,6 +1259,15 @@ void EditorFileSystem::_process_file_system(const ScannedDirectory *p_scan_dir,
}
}
}
+
+ if (fi->uid == ResourceUID::INVALID_ID && ResourceLoader::exists(path) && !ResourceLoader::has_custom_uid_support(path) && !FileAccess::exists(path + ".uid")) {
+ // Create a UID.
+ Ref<FileAccess> f = FileAccess::open(path + ".uid", FileAccess::WRITE);
+ if (f.is_valid()) {
+ fi->uid = ResourceUID::get_singleton()->create_id();
+ f->store_line(ResourceUID::get_singleton()->id_to_text(fi->uid));
+ }
+ }
}
if (fi->uid != ResourceUID::INVALID_ID) {