You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem or limitation you are having in your project
The are a few editors that can handle the same resource, this causes the issue of which one gets the priority to handle it first. You can see it happen with the AnimationTree node in godotengine/godot#93455.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
I have two possible solutions for this problem:
A priority system.
An optional integer could be given to an editor plugin, and when one is being picked to handle a resource, the one with the highest integer would be selected.
A sister function to handles(): opens().
Currently, the handles() function is used to check if an editor plugin can handle a resource, and all plugins that edit resources have it. The idea is that an opens() function is created, and plugins that shouldn't take priority to edit a resource (as in, opened automatically), should use it instead, so they will only edit a resource when the plugin is opened manually.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Priority system:
All editor plugins start with a priority of "0" as the default, a function named set_priority() would be used to edit it. When fetching the list of available plugins for a resource, this priority will be checked to decide which one edits it.
opens():
Editor plugins that should take priority when editing a resource would still use handles() as usual. Those that don't would use opens() instead, and this function would be used to check if a plugin opened manually can edit a resource.
If this enhancement will not be used often, can it be worked around with a few lines of script?
No.
Is there a reason why this should be core and not an add-on in the asset library?
An add-on wouldn't be able to fix this.
The text was updated successfully, but these errors were encountered:
For the purpose of fixing Animation issue, priority system is enough and sounds like very simple to implement.
I don't fully understand how opens() is supposed to work 🤔
I remember attempting to fix the same issue and my solution was conditional handles() (i.e. plugin returns true only when it can handle the node/resource right now), but I think it didn't work well and I can't find the code anywhere.
To keep it short: if a plugin should automatically open when a resourced is edited, use handles(), if not, opens().
In the end it's the plugin that opens its editor (via make_visible()), so you can handle that with custom logic. Though not sure if it's possible with bottom panel.
Describe the project you are working on
The Godot Engine.
Describe the problem or limitation you are having in your project
The are a few editors that can handle the same resource, this causes the issue of which one gets the priority to handle it first. You can see it happen with the
AnimationTree
node in godotengine/godot#93455.Describe the feature / enhancement and how it helps to overcome the problem or limitation
I have two possible solutions for this problem:
An optional integer could be given to an editor plugin, and when one is being picked to handle a resource, the one with the highest integer would be selected.
handles()
:opens()
.Currently, the
handles()
function is used to check if an editor plugin can handle a resource, and all plugins that edit resources have it. The idea is that anopens()
function is created, and plugins that shouldn't take priority to edit a resource (as in, opened automatically), should use it instead, so they will only edit a resource when the plugin is opened manually.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
All editor plugins start with a priority of "0" as the default, a function named
set_priority()
would be used to edit it. When fetching the list of available plugins for a resource, this priority will be checked to decide which one edits it.opens()
:Editor plugins that should take priority when editing a resource would still use
handles()
as usual. Those that don't would useopens()
instead, and this function would be used to check if a plugin opened manually can edit a resource.If this enhancement will not be used often, can it be worked around with a few lines of script?
No.
Is there a reason why this should be core and not an add-on in the asset library?
An add-on wouldn't be able to fix this.
The text was updated successfully, but these errors were encountered: