From b397add4566d6172010be39a102376c985acda3f Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Wed, 30 Oct 2024 12:40:15 -0300 Subject: [PATCH] Fix certain editor plugins not showing when they should --- editor/editor_node.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 0dd05d4e330..a051b87169c 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2318,16 +2318,20 @@ void EditorNode::edit_item(Object *p_object, Object *p_editing_owner) { active_plugins[owner_id].erase(plugin); } + LocalVector to_over_edit; + // Send the edited object to the plugins. for (EditorPlugin *plugin : available_plugins) { if (active_plugins[owner_id].has(plugin)) { - // Plugin was already active, just change the object. + // Plugin was already active, just change the object and ensure it's visible. + plugin->make_visible(true); plugin->edit(p_object); continue; } if (active_plugins.has(plugin->get_instance_id())) { // Plugin is already active, but as self-owning, so it needs a separate check. + plugin->make_visible(true); plugin->edit(p_object); continue; } @@ -2346,6 +2350,11 @@ void EditorNode::edit_item(Object *p_object, Object *p_editing_owner) { // Activate previously inactive plugin and edit the object. active_plugins[owner_id].insert(plugin); + // TODO: Call the function directly once a proper priority system is implemented. + to_over_edit.push_back(plugin); + } + + for (EditorPlugin *plugin : to_over_edit) { _plugin_over_edit(plugin, p_object); } }