Skip to content
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

Handle multiple editor plugins that target the same resource #11009

Open
YeldhamDev opened this issue Oct 21, 2024 · 0 comments
Open

Handle multiple editor plugins that target the same resource #11009

YeldhamDev opened this issue Oct 21, 2024 · 0 comments

Comments

@YeldhamDev
Copy link
Member

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:

  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant