Rework scene restoring#110183
Conversation
| Error err; | ||
| Ref<PackedScene> sdata = ResourceLoader::load(editor_data.get_scene_path(p_idx), "", ResourceFormatLoader::CACHE_MODE_REPLACE, &err); | ||
| Node *new_scene = sdata->instantiate(PackedScene::GEN_EDIT_STATE_MAIN); | ||
| editor_data.set_scene_root(p_idx, new_scene); |
There was a problem hiding this comment.
This part needs to be improved to include some basic error handling.
|
https://xkcd.com/1172/ Could we keep the toggle or better yet make a new property with 3 options: previous, main, none? |
85efb63 to
761d6f7
Compare
|
I restored the setting, but changing how it works is out of scope for this PR. |
761d6f7 to
4f9a0b7
Compare
|
If async loading of the scenes speeds up the editor, then we should totally do this – or possibly an iteration on this where the remaining scenes are loaded asynchronously in the background. I coincidentally didn't have any heavy-to-load scenes in the projects on my computer lol, but can you elaborate whether clicking on unloaded scenes also pops some sort of progress bar if it takes a little while? The hang in your video doesn't look great. We'd like to avoid 'software is unresponsive' kind of situations I think? |
|
I forgot this exists 🤔 |
Changed the way scene restoring works. Instead of loading all scenes, only the current scene is loaded, other scenes are opened as "dummy scenes". They are not being loaded until you switch to them. This makes the editor open fast regardless of how many scenes you had opened when closing.
godot.windows.editor.dev.x86_64_9fRMa1xSUw.mp4
As a result,
restore_scenes_on_loadsetting became obsolete and I removed it.Discussion for more context: https://chat.godotengine.org/channel/editor?msg=6MqBpHYC5xdJShs4z
Needs some testing.