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
I made a plugin which can edit a specific object with a graph editor. Selecting that object shows it (throught make_visible), and clicking on a GraphNode may allow to inspect properties of a sub-object using the inspector, similar to how VisualScript works. I made it so my plugin handles both object types, so my expectation was that it would not be made invisible when I select back and forth between these objects.
The problem is, when I use inspect(), Godot calls make_visible() on my plugin 4 times in a row, with alternating visibilities. Not only this is a waste as I cleanup my UI when my plugin is hidden, but even if I don't cleanup anything, hiding the GraphEdit breaks its input management, causing nodes to stick to the mouse, box selections to never end or to never be shown. It's basically unusable.
I would have expected make_visible() to not be called at all, because I edited another sub-object my plugin also handles.
Repro: PluginInspectMakeVisible.zip
Here I chose Sprite and GraphNode for the sake of testing, in reality my objects are different.
Open main.tscn
Select Sprite: the graph editor should open in the bottom panel, with 2 sample graphnodes in it
Select one of the graphnodes: observe the node sticks to the mouse unexpectedly.
I believe I'm hitting this same bug when using a Main Screen Plugin.
inspect_object() seems to be triggering make_visible calls when then lead to the GraphNode getting "stuck" to the mouse.
I can also reproduce this under exact same circumstances. Godot v3.5 stable. GraphNode simply sticks to the mouse.
Is there any way to prevent Godot from calling make_visible(false) when we need to inspect some sub-resource that our plugin uses?
EDIT: Just found the solution! Turns out the 3rd arg of get_editor_interface().inspect_object is exactly for this. Pass true in there to prevent Godot from treating the inspected resource as a subject for plugins. E.g.:
Godot 3.2.2
Windows 10 64 bits
As a continuation of #6459 (comment)
I made a plugin which can edit a specific object with a graph editor. Selecting that object shows it (throught
make_visible
), and clicking on aGraphNode
may allow to inspect properties of a sub-object using the inspector, similar to howVisualScript
works. I made it so my plugin handles both object types, so my expectation was that it would not be made invisible when I select back and forth between these objects.The problem is, when I use
inspect()
, Godot callsmake_visible()
on my plugin 4 times in a row, with alternating visibilities. Not only this is a waste as I cleanup my UI when my plugin is hidden, but even if I don't cleanup anything, hiding theGraphEdit
breaks its input management, causing nodes to stick to the mouse, box selections to never end or to never be shown. It's basically unusable.I would have expected
make_visible()
to not be called at all, because I edited another sub-object my plugin also handles.Repro:
PluginInspectMakeVisible.zip
Here I chose
Sprite
andGraphNode
for the sake of testing, in reality my objects are different.Sprite
: the graph editor should open in the bottom panel, with 2 sample graphnodes in itmake_visible
prints happened:3 prints due to EditorPlugin.make_visible() is called multiple times when selecting a node handled by the plugin #40165
4 additional prints from the present issue, due to selecting the second handled object:
I expected just one in total,
make_visible(true)
.The text was updated successfully, but these errors were encountered: