Overhaul scene loading and edit state management#116905
Conversation
|
Resolving the issues required some more radical changes, because the old code was an irredeemable mess (and I didn't even include all improvements, I'll probably do follow-ups). See OP for the summary of changes. Likely needs testing. I did test it and scene opening/closing/reloading/changing/soft reloading/etc is working, but maybe I missed some edge case. |
|
I have tested the PR extensively, both manually and with a monkey tester. It fixes the issue and it seems to have significantly improved reloading stability as well. |
|
An issue that I found in additional testing: If we call This is due to the deferred call to Basically: Stack trace up to that deferred call from |
Depends on godotengine/godot#116905 getting fixed
|
I can't reliably reproduce the crash. Does wrapping the item in Variant fix it for you? callable_mp(tree, &Tree::scroll_to_item).call_deferred(Variant(p_parent), false); |
|
@KoBeWi Yes it does, that resolves the issue. |
|
@YeldhamDev Can you review this PR? I have extensively tested this and we are currently using it in production without issue. |
|
When I try to open my test project it crashes, with this output: |
|
Is this on Linux? Can you post your test project? |
|
@nikitalita I am, but I don't think that's related. And I tried replicating it in a clean project, but no dice. It happens on a scene that has a child scene inside, and it's not always a crash, a lot of times it's just the Still, I also experienced some rare crashes doing unrelated stuff, like creating a fresh scene. I'm sorry I cannot provide more info, or a reliable way to reproduce those at least. |
|
Wait, I actually managed to find a reproducible bug with this:
|
|
Fixed. The editor was trying to open non-existent |
|
I managed to find a reliable way of reproducing the
|
|
Yeah, I already noted that the paths change may cause one-time errors. It happens only when opening project from earlier versions, so it's not that critical I think. |
YeldhamDev
left a comment
There was a problem hiding this comment.
Well, besides that issue, I couldn't find any other problems with it currently, so I guess it's fine. Would be nice if that error could be silenced somehow, but that's not a showstopper.
A second review would be appreciated.
bruvzg
left a comment
There was a problem hiding this comment.
Looks good. Having one time errors messages seems fine, but it probably should be mentioned on the Upgrading from Godot 4.6 to Godot 4.7 page.
|
Thanks! |
So as it turns out, it's one time per scene (and not fixed until you save it). I think it can be fixed by renaming the key for selected nodes. |
This PR makes a major overhaul on how scenes are loaded in the editor and how their edit state is handled.
load_scene()was renamed toopen_scene()load_scene()method that only loads a scene. The scene is not even added to the scene tree.open_scene()callsload_method()and then switches to the loaded scene.load_scene().editstatefiles resilient to editor structure changesauto_select_current_scene_filesettingSeems like this made CI fail xdFixes #116867
Fixes #116865
Might fix some other issues.