Skip to content

Commit 38ecaec

Browse files
committed
Create .uid files for detected new files
1 parent fde0616 commit 38ecaec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

editor/editor_file_system.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,12 @@ bool EditorFileSystem::_update_scan_actions() {
913913
// Re-assign the UID to file, just in case it was pulled from cache.
914914
ResourceSaver::set_uid(new_file_path, existing_id);
915915
}
916+
} else if (ResourceLoader::should_create_uid_file(new_file_path)) {
917+
Ref<FileAccess> f = FileAccess::open(new_file_path + ".uid", FileAccess::WRITE);
918+
if (f.is_valid()) {
919+
ia.new_file->uid = ResourceUID::get_singleton()->create_id();
920+
f->store_line(ResourceUID::get_singleton()->id_to_text(ia.new_file->uid));
921+
}
916922
}
917923

918924
if (ClassDB::is_parent_class(ia.new_file->type, SNAME("Script"))) {

0 commit comments

Comments
 (0)