diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-02-07 05:18:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-02-07 05:47:29 +0300 |
commit | 1778efc89777f3c25654254e33dc702f10cdf210 (patch) | |
tree | e32b23ba708088a7fd8ff7240ae9336ad61f0c5f /release/scripts | |
parent | d8830048f7ae9a9d2763111f062aeafba07069bc (diff) |
Keymap: preference to swap 3D orbit/pan actions
Requested by @pepeland for grease pencil/2D usage.
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/presets/keyconfig/blender.py | 19 | ||||
-rw-r--r-- | release/scripts/presets/keyconfig/keymap_data/blender_default.py | 13 |
2 files changed, 30 insertions, 2 deletions
diff --git a/release/scripts/presets/keyconfig/blender.py b/release/scripts/presets/keyconfig/blender.py index 8cbbb900154..73be645d037 100644 --- a/release/scripts/presets/keyconfig/blender.py +++ b/release/scripts/presets/keyconfig/blender.py @@ -108,6 +108,22 @@ class Prefs(bpy.types.KeyConfigPreferences): update=update_fn, ) + v3d_mmb_action: EnumProperty( + name="MMB Action", + items=( + ('ORBIT', "Orbit", + "Orbit", + 0), + ('PAN', "Pan", + "Set the view axis where each mouse direction always maps to the same axis", + 1), + ), + description=( + "The action when Middle-Mouse dragging in the viewport. Shift-Middle-Mouse is used for the other action" + ), + update=update_fn, + ) + v3d_alt_mmb_drag_action: EnumProperty( name="Alt-MMB Drag Action", items=( @@ -169,6 +185,8 @@ class Prefs(bpy.types.KeyConfigPreferences): col = split.column() col.label(text="Tilde Action:") col.row().prop(self, "v3d_tilde_action", expand=True) + col.label(text="Middle Mouse Action:") + col.row().prop(self, "v3d_mmb_action", expand=True) col.label(text="Alt Middle Mouse Drag Action:") col.row().prop(self, "v3d_alt_mmb_drag_action", expand=True) @@ -194,6 +212,7 @@ def load(): ), spacebar_action=kc_prefs.spacebar_action, v3d_tilde_action=kc_prefs.v3d_tilde_action, + use_v3d_mmb_pan=(kc_prefs.v3d_mmb_action == 'PAN'), v3d_alt_mmb_drag_action=kc_prefs.v3d_alt_mmb_drag_action, use_select_all_toggle=kc_prefs.use_select_all_toggle, use_v3d_tab_menu=kc_prefs.use_v3d_tab_menu, diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index bfd0066e66d..cc480a43de3 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -50,6 +50,8 @@ class Params: "use_v3d_tab_menu", # Use extended pie menu for shading. "use_v3d_shade_ex_pie", + # Swap orbit/pan keys (for 2D workflows). + "use_v3d_mmb_pan", # Experimental option. "use_pie_click_drag", "v3d_tilde_action", @@ -70,6 +72,7 @@ class Params: use_gizmo_drag=True, use_v3d_tab_menu=False, use_v3d_shade_ex_pie=False, + use_v3d_mmb_pan=False, use_pie_click_drag=False, v3d_tilde_action='VIEW', v3d_alt_mmb_drag_action='RELATIVE', @@ -119,6 +122,7 @@ class Params: self.use_select_all_toggle = use_select_all_toggle self.use_v3d_tab_menu = use_v3d_tab_menu self.use_v3d_shade_ex_pie = use_v3d_shade_ex_pie + self.use_v3d_mmb_pan = use_v3d_mmb_pan self.v3d_tilde_action = v3d_tilde_action self.v3d_alt_mmb_drag_action = v3d_alt_mmb_drag_action @@ -946,8 +950,13 @@ def km_view3d(params): ("view3d.localview", {"type": 'SLASH', "value": 'PRESS'}, None), ("view3d.localview_remove_from", {"type": 'M', "value": 'PRESS'}, None), # Navigation. - ("view3d.rotate", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None), - ("view3d.move", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True}, None), + *(( + ("view3d.rotate", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True}, None), + ("view3d.move", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None), + ) if params.use_v3d_mmb_pan else ( + ("view3d.rotate", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None), + ("view3d.move", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True}, None), + )), ("view3d.zoom", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "ctrl": True}, None), ("view3d.dolly", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, None), ("view3d.view_selected", {"type": 'NUMPAD_PERIOD', "value": 'PRESS', "ctrl": True}, |