-
-
Notifications
You must be signed in to change notification settings - Fork 20.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
EditorInspectorPlugin._parse_property
gets called on all plugins when inspecting an array inspector, regardless of can_handle
#71236
Comments
EditorInspectorPlugin._parse_property
gets called on all plugins when inspecting an array inspector, disregarding can_handle
EditorInspectorPlugin._parse_property
gets called on all plugins when inspecting an array inspector, regardless of can_handle
Maybe should call can_handle() before calling parse_property()? |
Just bumped again into a similar issue, but this time when clicking on a VisualShader |
I also ran into an unexpected call of Attached is a reduced scene to reproduce the error. Click on AnimationTree to observe something like these in the output:
The first line says |
Still hitting this in latest 4.1.1, my inspector plugin |
Still happening at HEAD. I have a custom look up for StringNames in different namespaces and it's impossible to invoke the right one when they are in an Array due to this issue :/ Also, I thought I would work around this issue by returning false in _parse_property(), which should cause the inspector to keep the original property editor instead of replacing it, but it doesn't seem to work like that for Arrays either, I guess due to the same difference in how arrays are treated. |
Godot version
Godot 4 beta11
System information
Windows 10 64 bits NVIDIA GeForce GTX 1060
Issue description
I have an inspector plugin that only handles a custom object type, but found out that
_parse_property
gets called on it every time I open an array inspector. I did not expect that because incan_handle
I returnfalse
already. But another problem is, there is no way to actually specify if an inspector plugin can handle non-object types.Another of my inspector plugins does not fail, but instead gets triggered unwantedly: it replaces AABB properties with a custom one that works differently. But as a result, it also triggers in Variant array inspectors where items are AABBs.
I'm not sure if it is a design issue or a documentation issue, because if it is the latter, it means every plugin has to check if the object is valid in this method, regardless of
can_handle
(I don't know if other methods are in this case too?).Call stack:
I don't know if it's the only place, but this happens because of this:
godot/editor/editor_properties_array_dict.cpp
Line 355 in f73cb4c
Which then results in this:
godot/editor/editor_inspector.cpp
Lines 2441 to 2443 in f73cb4c
Specifically in array and dict sub-inspectors,
can_handle
is not even checked (and in fact it can't because it only receives objects) thenparse_property
is called with anull
object on ALL inspector plugins. This does not happen for properties of objects.Steps to reproduce
Make an
EditorInspectorPlugin
that implements_parse_property
, for example:Make an
EditorPlugin
to register it.Enable the plugin.
Create a
Line2D
node.In the inspector, add points to the
Line2D
node, then expand the points property.Observe errors.
Minimal reproduction project
EditorInspectorPluginVariantType.zip
The text was updated successfully, but these errors were encountered: