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

EditorPlugin.edit is not called when EditorPlugin.handles() returns true for objects inside collections #56797

Open
AnidemDex opened this issue Jan 14, 2022 · 3 comments

Comments

@AnidemDex
Copy link

Godot version

v3.4.stable.official [206ba70]

System information

Windows 11 x64

Issue description

bXJZwHN1fa

If you're making a plugin and you try to edit a resource that you plugin handles, you'll notice that your edit() function is not called and that the array inspector is not opening the default editor.

As you can see in the gif, handles() method is called, but edit() is not.

No idea if those lines are related to it:

void EditorPropertyArray::_object_id_selected(const String &p_property, ObjectID p_id) {

bool EditorPropertyResource::_can_use_sub_inspector(const RES &p_resource) {

bool EditorPlugin::handles(Object *p_object) const {

Steps to reproduce

  1. Create a plugin
  2. Make it handles Resource
  3. Create the edit() function and put a print there
  4. In any other script, export an array and fill it with resources, the edit() is never called.

or

  1. Download the reproduction project
  2. Enable test_plugin

Minimal reproduction project

handles_test.zip

@Abdera7mane
Copy link

I could replicate the issue with Arrays and Dictionaries key/value, actually it appears to be the case with editing any object inside a sub-inspector and I believe this is related to #52984.

@AnidemDex
Copy link
Author

This issue is still true for Godot 4 (since Godot 4 to v4.2.beta5.official [4c96e96]), but for objects inspected in node properties:
image
image

It's called for resources and resources inspected in resource properties 🤔
image

Should I open a new issue?

@YuriSizov YuriSizov modified the milestones: 3.5, 3.x Nov 9, 2023
@YuriSizov
Copy link
Contributor

Should I open a new issue?

I think so, yes. Relevant bits have been reworked quite a lot in 4.x

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

4 participants