diff options
author | JFonS <JFonS@users.noreply.github.com> | 2022-06-02 13:02:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-02 13:02:48 +0200 |
commit | 8e3084cc91cf9a65f39b81b1187497c82614afe0 (patch) | |
tree | 8c9fc42c0211a9a2f24996d086e55c5a902cf40d | |
parent | 8abace0f79beb59becb2d63452a3db52685e3d3b (diff) | |
parent | 5d413eaa962bc5102a2fc8c1ba31dc9f2ccd577b (diff) |
Merge pull request #61292 from KoBeWi/hack_your_way_to_fix_the_bug
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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<Node3DEditorPlugin *>(this)->edit((Object *)nullptr); + return false; + } } Dictionary Node3DEditorPlugin::get_state() const { |