Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-create missing .uid files #100787

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Dec 24, 2024

Fixes #99779

The file is only created on editor restart, not sure how to detect that .uid file is deleted while the editor is running.

@@ -1260,11 +1260,13 @@ 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.
if (ResourceLoader::exists(path) && !ResourceLoader::has_custom_uid_support(path) && !FileAccess::exists(path + ".uid")) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both ResourceLoader methods go through all loaders and check if the file is recognized. I think this can be improved.

@hpvb
Copy link
Member

hpvb commented Dec 24, 2024

I think this should probably print a warning if this happens. This is a user error, and we cannot necessarily create the correct new .uid file, so I think we need to make sure that the user is informed that their project might be messed up.

@KoBeWi KoBeWi force-pushed the uid_be_like_'I'm_back' branch from 65731fa to e0ca8be Compare December 24, 2024 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.uid files are not recreated if deleted by the user
2 participants