-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Detect external modification of scenes #31747
Conversation
8f27164
to
b0665c2
Compare
I finally got around to fixing this and the crash is gone (not sure if related to what I did xd). Also the reloading is more seamless, there's no undo history noise at all. Probably needs some testing, but otherwise, the PR complete. I'd really like it for 3.2 >_> |
We're a bit too close to 3.2-stable for such a change IMO, so I'd prefer to merge after the release. We can cherry-pick for 3.2 though if it proves to work well in the master branch. |
Why such a nice feature still not available in the latest release? |
c56ebd5
to
61a053c
Compare
Ok, rebased and fixed. However due to #37531, the dialog will pop up infinitely when you try to cancel/close it (because editor gets refocused), so you are either forced to save scene or reload. |
As far as I can tell from the diff, this only takes into account open scenes, right? But these are not the only files, that need to be reloaded. The |
Note that the user can have more than just scenes open. What's on disk are resources, so it's actually about resources. Resources can be scripts, scenes, or standalone resources open in the inspector. Is the latter handled as well? |
Resources in Godot are usually built-in, so this PR handles most of the problems. But I didn't test file Resources, they might indeed be a problem. project.godot is not handled yet either. |
No? I dunno what that comes from (we dont have stats?) but there are a bunch of cases where resources authored inside Godot are files (themes, custom resources, some materials, default environment, scripts, audio bus layout...). I also use lots of file resources myself, and actually rarely make them builtin. |
Dunno, 99% of non-imported resources in my project are built-in (they are mostly collision shapes). Script changes are already handled by script editor. |
61a053c
to
256bd52
Compare
256bd52
to
76c17cf
Compare
I rebased the PR. Also I added detecting changes to |
Ah, I forgot to write here, but I tested this PR during the GGJ and it works fine. There are two problems though:
However they are separate issues not really related to this PR. I'd say it's ready to be merged. |
76c17cf
to
f699645
Compare
f699645
to
c390c82
Compare
Thanks! |
disk_changed->connect("confirmed", callable_mp(this, &EditorNode::_reload_modified_scenes)); | ||
disk_changed->connect("confirmed", callable_mp(this, &EditorNode::_reload_project_settings)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're connecting two callables to the same signal, bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is intended. I made reloading scenes and project settings into separate methods.
If you're up for it, I'd suggest making a dedicated backport PR for |
With this change, editor will look for external modifications in opened scenes when focused and asks for reload. This is analogical to scripts in ScriptEditorPlugin.
Closes #11803
Also closes #20250, which is a duplicate
Also closes #22450, which is a duplicate duplicate