-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Rework EditorPlugin editing logic #71770
Rework EditorPlugin editing logic #71770
Conversation
Thank you for this 👍🏽 Lifting these limitations I believe also helps open up enhancements to multi-window support of the bottom panels which I want to work on. |
bb859ee
to
f784598
Compare
Ok this is more or less finished. I removed some methods regarding top editors and folding properties, as they are now handled differently. I will give this PR some testing, but the biggest problem that may happen (aside from random oversights) is that not all plugins handle editing |
I really like this, super clean. |
f784598
to
4ae168e
Compare
Would that fix #70914 too, or do we still need to fix relevant plugins? |
Yes. |
Thanks! |
I can very reliably get a segfault here where p_object is null with the scatter plugin. Wouldn't a null check be necessary here or this is not supposed to happen? |
See #71859 |
Yes I've just seen it, you're too fast ;) |
|
Kind of revival of #45085
The aim of this PR is to make editing Nodes and Resources more reliable. EditorPlugins will now receive
edit(something)
when necessary andedit(nullptr)
when they are supposed finish editing. Also the limitation of only one active plugin is lifted.The PR introduces concept of "editing owner". When a resource is edited, the system that triggered the editing becomes the "owner". It can be SceneTreeDock (by selecting node), Inspector (by opening a resource file) or EditorPropertyResource (by unfolding a sub-resource). The idea is that each owner can have its own active editor (or editors), which allows to fix certain issues where you can't edit two things at once. I also added logic for determining whether an "owner" is currently editing something or is no longer editing it, so plugins can be explicitly notified that they should stop editing.
Fixes #13849
Fixes #32002
Fixes #43635
Fixes #70914
Opening as draft, because the PR is unfinished. I confirmed that it fixes the issues, but it might have unwanted side-effects and the code is a mess right now.