From 87d97fe7d84f218a62b09b890b3e1039a063fe66 Mon Sep 17 00:00:00 2001 From: Robert Yevdokimov Date: Tue, 30 Jan 2024 22:31:52 -0500 Subject: [PATCH] Fix a regression in #86804 that breaks gizmos transforming when 'View Gizmos' is off --- editor/plugins/node_3d_editor_plugin.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index e4d24832bff..2c24174524f 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -1749,7 +1749,8 @@ void Node3DEditorViewport::_sinput(const Ref &p_event) { _edit.mode = TRANSFORM_NONE; _edit.original = spatial_editor->get_gizmo_transform(); // To prevent to break when flipping with scale. - bool can_select_gizmos = spatial_editor->get_single_selected_node(); + bool node_selected = spatial_editor->get_single_selected_node(); + bool can_select_gizmos = node_selected; { int idx = view_menu->get_popup()->get_item_index(VIEW_GIZMOS); @@ -1839,17 +1840,17 @@ void Node3DEditorViewport::_sinput(const Ref &p_event) { clicked = ObjectID(); - if (can_select_gizmos && ((spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT && b->is_command_or_control_pressed()) || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_ROTATE)) { + if (node_selected && ((spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT && b->is_command_or_control_pressed()) || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_ROTATE)) { begin_transform(TRANSFORM_ROTATE, false); break; } - if (can_select_gizmos && spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE) { + if (node_selected && spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE) { begin_transform(TRANSFORM_TRANSLATE, false); break; } - if (can_select_gizmos && spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE) { + if (node_selected && spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE) { begin_transform(TRANSFORM_SCALE, false); break; }