From 5d413eaa962bc5102a2fc8c1ba31dc9f2ccd577b Mon Sep 17 00:00:00 2001 From: kobewi Date: Sun, 22 May 2022 21:28:47 +0200 Subject: Redraw selected 3D gizmo on deselect --- editor/plugins/node_3d_editor_plugin.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index cbdb1e520a..a0ca219c61 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -8126,7 +8126,13 @@ void Node3DEditorPlugin::edit(Object *p_object) { } bool Node3DEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("Node3D"); + if (p_object->is_class("Node3D")) { + return true; + } else { + // This ensures that gizmos are cleared when selecting a non-Node3D node. + const_cast(this)->edit((Object *)nullptr); + return false; + } } Dictionary Node3DEditorPlugin::get_state() const { -- cgit v1.2.3