diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-01-19 03:49:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-01-19 04:20:48 +0300 |
commit | 58e554a55c66bbb8f83351d4e50d2a86908cb0dd (patch) | |
tree | 2aec4b08c01a2cae4c80ed2e3634895b02cb1613 /release/scripts/presets | |
parent | b5c3f26cba81c969a42255e689a26c1b7c89115b (diff) |
Fix T66681: Blender 2.7x keymap inconsistencies
Match Blender 2.7x keymap more closely.
- Image Editor: F3 for save image as.
- Node Editor: Ctrl-LMB to cut links.
- Cycle the falloff types instead of showing a pie-menu.
- Use regular menu instead of pie menu for snapping.
Diffstat (limited to 'release/scripts/presets')
-rw-r--r-- | release/scripts/presets/keyconfig/keymap_data/blender_default.py | 127 |
1 files changed, 88 insertions, 39 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index c0e0d4d3dbc..287322e9a29 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -290,11 +290,16 @@ def _template_items_uv_select_mode(params): ] -def _template_items_proportional_editing(*, connected=False): +def _template_items_proportional_editing(params, *, connected, toggle_data_path): return [ - op_menu_pie("VIEW3D_MT_proportional_editing_falloff_pie", {"type": 'O', "value": 'PRESS', "shift": True}), + ( + op_menu_pie("VIEW3D_MT_proportional_editing_falloff_pie", {"type": 'O', "value": 'PRESS', "shift": True}) + if not params.legacy else + ("wm.context_cycle_enum", {"type": 'O', "value": 'PRESS', "shift": True}, + {"properties": [("data_path", 'tool_settings.proportional_edit_falloff'), ("wrap", True)]}) + ), ("wm.context_toggle", {"type": 'O', "value": 'PRESS'}, - {"properties": [("data_path", 'tool_settings.use_proportional_edit')]}), + {"properties": [("data_path", toggle_data_path)]}), *(() if not connected else ( ("wm.context_toggle", {"type": 'O', "value": 'PRESS', "alt": True}, {"properties": [("data_path", 'tool_settings.use_proportional_connected')]}), @@ -918,9 +923,14 @@ def km_uv_editor(params): ("uv.hide", {"type": 'H', "value": 'PRESS', "shift": True}, {"properties": [("unselected", True)]}), ("uv.reveal", {"type": 'H', "value": 'PRESS', "alt": True}, None), - op_menu_pie("IMAGE_MT_uvs_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}), + ( + op_menu_pie("IMAGE_MT_uvs_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}) + if not params.legacy else + op_menu("IMAGE_MT_uvs_snap", {"type": 'S', "value": 'PRESS', "shift": True}) + ), op_menu("IMAGE_MT_uvs_select_mode", {"type": 'TAB', "value": 'PRESS', "ctrl": True}), - *_template_items_proportional_editing(connected=False), + *_template_items_proportional_editing( + params, connected=False, toggle_data_path='tool_settings.use_proportional_edit'), ("transform.translate", {"type": 'G', "value": 'PRESS'}, None), ("transform.translate", {"type": params.select_tweak, "value": 'ANY'}, None), ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None), @@ -1218,17 +1228,22 @@ def km_view3d(params): ("transform.tosphere", {"type": 'S', "value": 'PRESS', "shift": True, "alt": True}, None), ("transform.shear", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), ("transform.mirror", {"type": 'M', "value": 'PRESS', "ctrl": True}, None), + ("object.transform_axis_target", {"type": 'T', "value": 'PRESS', "shift": True}, None), + ("transform.skin_resize", {"type": 'A', "value": 'PRESS', "ctrl": True}, None), + # Snapping. ("wm.context_toggle", {"type": 'TAB', "value": 'PRESS', "shift": True}, {"properties": [("data_path", 'tool_settings.use_snap')]}), op_panel("VIEW3D_PT_snapping", {"type": 'TAB', "value": 'PRESS', "shift": True, "ctrl": True}, [("keep_open", True)]), - ("object.transform_axis_target", {"type": 'T', "value": 'PRESS', "shift": True}, None), - ("transform.skin_resize", {"type": 'A', "value": 'PRESS', "ctrl": True}, None), + ( + op_menu_pie("VIEW3D_MT_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}) + if not params.legacy else + op_menu("VIEW3D_MT_snap", {"type": 'S', "value": 'PRESS', "shift": True}) + ), ]) if not params.legacy: # New pie menus. items.extend([ - op_menu_pie("VIEW3D_MT_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}), ("wm.context_toggle", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "ctrl": True}, {"properties": [("data_path", 'space_data.show_gizmo')]}), op_menu_pie("VIEW3D_MT_pivot_pie", {"type": 'PERIOD', "value": 'PRESS'}), @@ -1249,7 +1264,6 @@ def km_view3d(params): else: items.extend([ # Old navigation. - op_menu("VIEW3D_MT_snap", {"type": 'S', "value": 'PRESS', "shift": True}), ("view3d.view_lock_to_active", {"type": 'NUMPAD_PERIOD', "value": 'PRESS', "shift": True}, None), ("view3d.view_lock_clear", {"type": 'NUMPAD_PERIOD', "value": 'PRESS', "alt": True}, None), ("view3d.navigate", {"type": 'F', "value": 'PRESS', "shift": True}, None), @@ -1338,9 +1352,8 @@ def km_mask_editing(params): items.extend([ ("mask.new", {"type": 'N', "value": 'PRESS', "alt": True}, None), op_menu("MASK_MT_add", {"type": 'A', "value": 'PRESS', "shift": True}), - op_menu_pie("VIEW3D_MT_proportional_editing_falloff_pie", {"type": 'O', "value": 'PRESS', "shift": True}), - ("wm.context_toggle", {"type": 'O', "value": 'PRESS'}, - {"properties": [("data_path", 'tool_settings.use_proportional_edit_mask')]}), + *_template_items_proportional_editing( + params, connected=False, toggle_data_path='tool_settings.use_proportional_edit_mask'), ("mask.add_vertex_slide", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None), ("mask.add_feather_vertex_slide", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, None), ("mask.delete", {"type": 'X', "value": 'PRESS'}, None), @@ -1557,7 +1570,11 @@ def km_graph_editor(params): ("graph.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("graph.select_linked", {"type": 'L', "value": 'PRESS'}, None), ("graph.frame_jump", {"type": 'G', "value": 'PRESS', "ctrl": True}, None), - op_menu_pie("GRAPH_MT_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}), + ( + op_menu_pie("GRAPH_MT_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}) + if not params.legacy else + ("graph.snap", {"type": 'S', "value": 'PRESS', "shift": True}, None) + ), ("graph.mirror", {"type": 'M', "value": 'PRESS', "ctrl": True}, None), ("graph.handle_type", {"type": 'V', "value": 'PRESS'}, None), ("graph.interpolation_type", {"type": 'T', "value": 'PRESS'}, None), @@ -1591,9 +1608,8 @@ def km_graph_editor(params): {"properties": [("mode", 'TIME_EXTEND')]}), ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None), ("transform.resize", {"type": 'S', "value": 'PRESS'}, None), - ("wm.context_toggle", {"type": 'O', "value": 'PRESS'}, - {"properties": [("data_path", 'tool_settings.use_proportional_fcurve')]}), - op_menu_pie("VIEW3D_MT_proportional_editing_falloff_pie", {"type": 'O', "value": 'PRESS', "shift": True}), + *_template_items_proportional_editing( + params, connected=False, toggle_data_path='tool_settings.use_proportional_fcurve'), ("marker.add", {"type": 'M', "value": 'PRESS'}, None), ("marker.rename", {"type": 'M', "value": 'PRESS', "ctrl": True}, None), *_template_items_context_menu("GRAPH_MT_context_menu", params.context_menu_event), @@ -1626,7 +1642,7 @@ def km_graph_editor(params): return keymap -def km_image_generic(_params): +def km_image_generic(params): items = [] keymap = ( "Image Generic", @@ -1644,12 +1660,20 @@ def km_image_generic(_params): ("image.reload", {"type": 'R', "value": 'PRESS', "alt": True}, None), ("image.read_viewlayers", {"type": 'R', "value": 'PRESS', "ctrl": True}, None), ("image.save", {"type": 'S', "value": 'PRESS', "alt": True}, None), - ("image.save_as", {"type": 'S', "value": 'PRESS', "shift": True, "alt": True}, None), ("image.cycle_render_slot", {"type": 'J', "value": 'PRESS', "repeat": True}, None), ("image.cycle_render_slot", {"type": 'J', "value": 'PRESS', "alt": True, "repeat": True}, {"properties": [("reverse", True)]}), ]) + if not params.legacy: + items.extend([ + ("image.save_as", {"type": 'S', "value": 'PRESS', "shift": True, "alt": True}, None), + ]) + else: + items.extend([ + ("image.save_as", {"type": 'F3', "value": 'PRESS'}, None), + ]) + return keymap @@ -1786,11 +1810,20 @@ def km_node_editor(params): ] # Allow node selection with both for RMB select - if params.select_mouse == 'RIGHTMOUSE': - items.extend(node_select_ops('LEFTMOUSE')) - items.extend(node_select_ops('RIGHTMOUSE')) + if not params.legacy: + if params.select_mouse == 'RIGHTMOUSE': + items.extend(node_select_ops('LEFTMOUSE')) + items.extend(node_select_ops('RIGHTMOUSE')) + else: + items.extend(node_select_ops('LEFTMOUSE')) else: - items.extend(node_select_ops('LEFTMOUSE')) + items.extend(node_select_ops('RIGHTMOUSE')) + items.extend([ + ("node.select", {"type": 'LEFTMOUSE', "value": 'PRESS'}, + {"properties": [("extend", False), ("deselect_all", False)]}), + ("node.select", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, + {"properties": [("extend", True)]}), + ]) items.extend([ ("node.select_box", {"type": params.select_tweak, "value": 'ANY'}, @@ -1805,8 +1838,8 @@ def km_node_editor(params): ("node.link", {"type": 'EVT_TWEAK_L', "value": 'ANY', "ctrl": True}, {"properties": [("detach", True)]}), ("node.resize", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None), - ("node.add_reroute", {"type": 'EVT_TWEAK_R', "value": 'ANY', "shift": True}, None), - ("node.links_cut", {"type": 'EVT_TWEAK_R', "value": 'ANY', "ctrl": True}, None), + ("node.add_reroute", {"type": 'EVT_TWEAK_L' if params.legacy else 'EVT_TWEAK_R', "value": 'ANY', "shift": True}, None), + ("node.links_cut", {"type": 'EVT_TWEAK_L' if params.legacy else 'EVT_TWEAK_R', "value": 'ANY', "ctrl": True}, None), ("node.select_link_viewer", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, None), ("node.backimage_move", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "alt": True}, None), ("node.backimage_zoom", {"type": 'V', "value": 'PRESS', "repeat": True}, @@ -2132,7 +2165,11 @@ def km_dopesheet(params): ("action.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("action.select_linked", {"type": 'L', "value": 'PRESS'}, None), ("action.frame_jump", {"type": 'G', "value": 'PRESS', "ctrl": True}, None), - op_menu_pie("DOPESHEET_MT_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}), + ( + op_menu_pie("DOPESHEET_MT_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}) + if not params.legacy else + ("action.snap", {"type": 'S', "value": 'PRESS', "shift": True}, None) + ), ("action.mirror", {"type": 'M', "value": 'PRESS', "ctrl": True}, None), ("action.handle_type", {"type": 'V', "value": 'PRESS'}, None), ("action.interpolation_type", {"type": 'T', "value": 'PRESS'}, None), @@ -2165,9 +2202,8 @@ def km_dopesheet(params): {"properties": [("mode", 'TIME_SCALE')]}), ("transform.transform", {"type": 'T', "value": 'PRESS', "shift": True}, {"properties": [("mode", 'TIME_SLIDE')]}), - ("wm.context_toggle", {"type": 'O', "value": 'PRESS'}, - {"properties": [("data_path", 'tool_settings.use_proportional_action')]}), - op_menu_pie("VIEW3D_MT_proportional_editing_falloff_pie", {"type": 'O', "value": 'PRESS', "shift": True}), + *_template_items_proportional_editing( + params, connected=False, toggle_data_path='tool_settings.use_proportional_action'), ("marker.add", {"type": 'M', "value": 'PRESS'}, None), ("marker.rename", {"type": 'M', "value": 'PRESS', "ctrl": True}, None), ("marker.camera_bind", {"type": 'B', "value": 'PRESS', "ctrl": True}, None), @@ -2285,7 +2321,11 @@ def km_nla_editor(params): ("nla.move_down", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True}, None), ("nla.apply_scale", {"type": 'A', "value": 'PRESS', "ctrl": True}, None), ("nla.clear_scale", {"type": 'S', "value": 'PRESS', "alt": True}, None), - op_menu_pie("NLA_MT_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}), + ( + op_menu_pie("NLA_MT_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}) + if not params.legacy else + ("nla.snap", {"type": 'S', "value": 'PRESS', "shift": True}, None) + ), ("nla.fmodifier_add", {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True}, None), ("transform.transform", {"type": 'G', "value": 'PRESS'}, {"properties": [("mode", 'TRANSLATION')]}), @@ -3240,7 +3280,11 @@ def km_grease_pencil_stroke_edit_mode(params): ("gpencil.copy", {"type": 'C', "value": 'PRESS', "ctrl": True}, None), ("gpencil.paste", {"type": 'V', "value": 'PRESS', "ctrl": True}, None), # Snap - op_menu_pie("GPENCIL_MT_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}), + ( + op_menu_pie("GPENCIL_MT_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}) + if not params.legacy else + op_menu("GPENCIL_MT_snap", {"type": 'S', "value": 'PRESS', "shift": True}) + ), # Show/hide ("gpencil.reveal", {"type": 'H', "value": 'PRESS', "alt": True}, None), ("gpencil.hide", {"type": 'H', "value": 'PRESS'}, @@ -3268,7 +3312,8 @@ def km_grease_pencil_stroke_edit_mode(params): ("transform.transform", {"type": 'F', "value": 'PRESS', "shift": True}, {"properties": [("mode", 'GPENCIL_OPACITY')]}), # Proportional editing. - *_template_items_proportional_editing(connected=True), + *_template_items_proportional_editing( + params, connected=True, toggle_data_path='tool_settings.use_proportional_edit'), # Curve edit mode toggle. ("wm.context_toggle", {"type": 'U', "value": 'PRESS'}, {"properties": [("data_path", 'gpencil_data.use_curve_edit')]}), @@ -4033,9 +4078,8 @@ def km_object_mode(params): ) items.extend([ - op_menu_pie("VIEW3D_MT_proportional_editing_falloff_pie", {"type": 'O', "value": 'PRESS', "shift": True}), - ("wm.context_toggle", {"type": 'O', "value": 'PRESS'}, - {"properties": [("data_path", 'tool_settings.use_proportional_edit_objects')]}), + *_template_items_proportional_editing( + params, connected=False, toggle_data_path='tool_settings.use_proportional_edit_objects'), *_template_items_select_actions(params, "object.select_all"), ("object.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None), ("object.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None), @@ -4199,7 +4243,8 @@ def km_curve(params): ("curve.normals_make_consistent", {"type": 'N', "value": 'PRESS', "ctrl" if params.legacy else "shift": True}, None), ("object.vertex_parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True}, None), op_menu("VIEW3D_MT_hook", {"type": 'H', "value": 'PRESS', "ctrl": True}), - *_template_items_proportional_editing(connected=True), + *_template_items_proportional_editing( + params, connected=True, toggle_data_path='tool_settings.use_proportional_edit'), *_template_items_context_menu("VIEW3D_MT_edit_curve_context_menu", params.context_menu_event), ]) @@ -4635,7 +4680,8 @@ def km_mesh(params): op_menu("VIEW3D_MT_vertex_group", {"type": 'G', "value": 'PRESS', "ctrl": True}), op_menu("VIEW3D_MT_edit_mesh_normals", {"type": 'N', "value": 'PRESS', "alt": True}), ("object.vertex_group_remove_from", {"type": 'G', "value": 'PRESS', "ctrl": True, "alt": True}, None), - *_template_items_proportional_editing(connected=True), + *_template_items_proportional_editing( + params, connected=True, toggle_data_path='tool_settings.use_proportional_edit'), *_template_items_context_menu("VIEW3D_MT_edit_mesh_context_menu", params.context_menu_event), ]) @@ -4767,7 +4813,8 @@ def km_metaball(params): ("mball.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None), *_template_items_select_actions(params, "mball.select_all"), ("mball.select_similar", {"type": 'G', "value": 'PRESS', "shift": True}, None), - *_template_items_proportional_editing(connected=True), + *_template_items_proportional_editing( + params, connected=True, toggle_data_path='tool_settings.use_proportional_edit'), *_template_items_context_menu("VIEW3D_MT_edit_metaball_context_menu", params.context_menu_event), ]) @@ -4790,7 +4837,8 @@ def km_lattice(params): ("object.vertex_parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True}, None), ("lattice.flip", {"type": 'F', "value": 'PRESS', "alt": True}, None), op_menu("VIEW3D_MT_hook", {"type": 'H', "value": 'PRESS', "ctrl": True}), - *_template_items_proportional_editing(connected=False), + *_template_items_proportional_editing( + params, connected=False, toggle_data_path='tool_settings.use_proportional_edit'), *_template_items_context_menu("VIEW3D_MT_edit_lattice_context_menu", params.context_menu_event), ]) @@ -4836,7 +4884,8 @@ def km_particle(params): for i, value in enumerate(('PATH', 'POINT', 'TIP')) ) ), - *_template_items_proportional_editing(connected=False), + *_template_items_proportional_editing( + params, connected=False, toggle_data_path='tool_settings.use_proportional_edit'), *_template_items_context_menu("VIEW3D_MT_particle_context_menu", params.context_menu_event), ]) |