-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
EditorInterface.get_edited_scene_root().queue_free()
will crash the editor.
#90176
Comments
The best we could do here I'd say is prevent it being freed, otherwise this is a case in my opinion if destructive use of the engine, I'd say you should expect issues if you try to delete stuff that the editor handles We could theoretically add some detection if scene is deleted and close the tab, but that'd be assuming malicious use, and how would we handle saving, connections, etc. |
Maybe. Deleting the root node isn't outside normal usage of the engine. Doing this will work and take you to the screenshot in the issue. I'm basically looking for a reverse of this (if/when it gets implemented): #90136, to build out an undo/redo system for plugins. |
Deleting the root node not through the editor isn't though, they're fundamentally different |
Well yeah, it crashes the editor lol. I'll agree with that point. It would be nice if I could delete the root node via scripts, but at a minimum, sure it shouldn't crash. |
Related: #26409 |
So what would the solution be? To just complain and close the tab without saving I assume? There's no way to recover the node when deleted |
I don't see why not. You also don't have a way to recover nodes you delete when you use |
Then the solution is to just recover gracefully, as opposed to crashing, and not trying to fix anything, that's a good solution, but people might not like it (also |
Fair point, I suppose I think this comment in the issue referenced above puts it pretty aptly: #26409 (comment) |
Tested versions
v4.3.dev5.mono.official [89f70e9]
System information
Godot v4.3.dev5.mono - Windows 10.0.22631 - Vulkan (Forward+) - integrated AMD Radeon(TM) Graphics (Advanced Micro Devices, Inc.; 31.0.24002.92) - AMD Ryzen 7 PRO 6850U with Radeon Graphics (16 Threads)
Issue description
Might be trying something dumb here, but trying to delete the root node via the title method to go back to this in the editor:
Get a crash instead.
ERROR: Cannot get path of node as it is not in a scene tree.
at: (scene/main/node.cpp:2188)
ERROR: Condition "!is_inside_tree()" is true. Returning: false
at: can_process (scene/main/node.cpp:791)
Steps to reproduce
File->Run
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: