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 Jun 12, 2023
1 parent 593d5ca commit fcc7f90
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 @@ -5112,9 +5112,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 @@ -8141,7 +8141,7 @@ Node3DEditor::Node3DEditor() {
tool_button[TOOL_MODE_SCALE]->set_toggle_mode(true);
tool_button[TOOL_MODE_SCALE]->set_flat(true);
tool_button[TOOL_MODE_SCALE]->connect("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);

main_menu_hbox->add_child(memnew(VSeparator));
Expand Down

0 comments on commit fcc7f90

Please sign in to comment.