Skip to content

Commit

Permalink
Bind Blender-style translate, rotate and scale shortcuts in the 3D ed…
Browse files Browse the repository at this point in the history
…itor

These used to have no binds by default, which severely limited their
discoverability.

The default bindings are the same as in Blender: G for translate, R
for rotate, S for scale.

The default shortcut for the Rotate tool has been moved to Ctrl + R
(Cmd + R) on macOS to accomodate for this change. While this makes
the shortcut less consistent with the usual "Q-W-E-R-T" line of shortcuts,
quick rotation with Blender-style transforms is arguably more convenient
during day-to-day editor operation. To avoid breaking people's muscle memory,
we should try to use shortcuts as similar as possible to Blender's.

The S key is only used for scaling if not currently in freelook mode.
  • Loading branch information
Calinou committed Aug 21, 2024
1 parent 826de79 commit 04aa1f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions editor/plugins/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5381,9 +5381,9 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p
ED_SHORTCUT("spatial_editor/lock_transform_xz", TTR("Lock Transformation to XZ plane"), KeyModifierMask::SHIFT | Key::Y);
ED_SHORTCUT("spatial_editor/lock_transform_xy", TTR("Lock Transformation to XY plane"), KeyModifierMask::SHIFT | Key::Z);
ED_SHORTCUT("spatial_editor/cancel_transform", TTR("Cancel Transformation"), Key::ESCAPE);
ED_SHORTCUT("spatial_editor/instant_translate", TTR("Begin Translate Transformation"));
ED_SHORTCUT("spatial_editor/instant_rotate", TTR("Begin Rotate Transformation"));
ED_SHORTCUT("spatial_editor/instant_scale", TTR("Begin Scale Transformation"));
ED_SHORTCUT("spatial_editor/instant_translate", TTR("Begin Translate Transformation"), Key::G);
ED_SHORTCUT("spatial_editor/instant_rotate", TTR("Begin Rotate Transformation"), Key::R);
ED_SHORTCUT("spatial_editor/instant_scale", TTR("Begin Scale Transformation"), Key::S);

preview_camera = memnew(CheckBox);
preview_camera->set_text(TTR("Preview"));
Expand Down Expand Up @@ -8555,7 +8555,7 @@ Node3DEditor::Node3DEditor() {
tool_button[TOOL_MODE_SCALE]->set_toggle_mode(true);
tool_button[TOOL_MODE_SCALE]->set_theme_type_variation("FlatButton");
tool_button[TOOL_MODE_SCALE]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_SCALE));
tool_button[TOOL_MODE_SCALE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_scale", TTR("Scale Mode"), Key::R));
tool_button[TOOL_MODE_SCALE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_scale", TTR("Scale Mode"), KeyModifierMask::CMD_OR_CTRL | Key::R));
tool_button[TOOL_MODE_SCALE]->set_shortcut_context(this);
tool_button[TOOL_MODE_SCALE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Use snap.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked."));

Expand Down

0 comments on commit 04aa1f6

Please sign in to comment.