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

Fix dependency handling on move or rename in the filesystem dock #81657

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

Jordyfel
Copy link
Contributor

@Jordyfel Jordyfel commented Sep 14, 2023

Fixes #79850.
...and probably more.

Moving a scene's dependency in the filesystem while the scene is open should no longer corrupt the scene.
Moving a scene together with it's dependency while it's open should no longer crash the engine.
Also fixes most of the error spam that was happening when moving things around.

Open scenes which depend on moved files are now saved before the move, which prevents losing unsaved changes like before, but in a less error-prone way.
The ResourceUID system is properly informed of resources changing paths now, this was the source of most of the problems.
A lot of expensive function calls were removed, moving things around in the filesystem should be faster.
There are some errors remaining related to scripts being looked for in the old location, but nothing seems to actually break now.

Please test this by moving stuff around in the filesystem with a copy of your non-trivial project.

Bugsquad edit: Fixes #77289 Fixes #59116

editor/filesystem_dock.cpp Outdated Show resolved Hide resolved
editor/filesystem_dock.cpp Outdated Show resolved Hide resolved
@Jordyfel Jordyfel force-pushed the editor-thing branch 2 times, most recently from 795cf34 to b440ef5 Compare September 14, 2023 18:49
@KoBeWi
Copy link
Member

KoBeWi commented Sep 15, 2023

Seems like this fixes all crashes and errors when moving scenes (I didn't do super extensive testing though).
However the scene internal ids of resources change after moving. Is there any way to preserve them? (not critical for this PR though)

@Jordyfel
Copy link
Contributor Author

Currently, I don't know what this depends on... I wish I could understand all the related systems so I can clean up these functions properly instead of continuing this chain of patch after patch, but that would take a while.

editor/filesystem_dock.cpp Outdated Show resolved Hide resolved
editor/filesystem_dock.cpp Outdated Show resolved Hide resolved
@Jordyfel
Copy link
Contributor Author

Also found #59116

Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

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

Looks reasonable enough to give it a try. Great job!

@YuriSizov YuriSizov merged commit e5ad3d4 into godotengine:master Sep 15, 2023
@YuriSizov
Copy link
Contributor

Thanks! Let's see if anything falls off :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants