Skip to content

Commit e0ca8be

Browse files
committed
Re-create missing .uid files
1 parent 0f95e9f commit e0ca8be

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

editor/editor_file_system.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -1260,11 +1260,15 @@ void EditorFileSystem::_process_file_system(const ScannedDirectory *p_scan_dir,
12601260
}
12611261
}
12621262

1263-
if (fi->uid == ResourceUID::INVALID_ID && ResourceLoader::exists(path) && !ResourceLoader::has_custom_uid_support(path) && !FileAccess::exists(path + ".uid")) {
1264-
// Create a UID.
1263+
if (ResourceLoader::exists(path) && !ResourceLoader::has_custom_uid_support(path) && !FileAccess::exists(path + ".uid")) {
1264+
// Create a UID file and new UID, if it's invalid.
12651265
Ref<FileAccess> f = FileAccess::open(path + ".uid", FileAccess::WRITE);
12661266
if (f.is_valid()) {
1267-
fi->uid = ResourceUID::get_singleton()->create_id();
1267+
if (fi->uid == ResourceUID::INVALID_ID) {
1268+
fi->uid = ResourceUID::get_singleton()->create_id();
1269+
} else {
1270+
WARN_PRINT(vformat("Missing .uid file for path \"%s\". The file was re-created from cache.", path));
1271+
}
12681272
f->store_line(ResourceUID::get_singleton()->id_to_text(fi->uid));
12691273
}
12701274
}

0 commit comments

Comments
 (0)