Keymap: continued testing/development
authorCampbell Barton <ideasman42@gmail.com>
Thu, 7 Jun 2018 18:46:12 +0000 (20:46 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 7 Jun 2018 18:46:12 +0000 (20:46 +0200)
After testing in the studio and extending the event system for
drag events, we've agreed on adjustments to the new keymap,
see: T55162

- Tab: Edit-mode toggle.
- Tab + Cursor Drag: mode switching pie menu.
- Accent/Grave: for 3D view pie menu.
- F3: Search
- 1..3, Shift-1..3: Edit mesh vertex/edge/face toggle.

Other minor changes were made, however they aren't part of the design.

- Ctrl-Shift-S: Image editor Save-As (was F3)
- Ctrl-Alt-R: Repeat history (was F3)

release/scripts/startup/bl_ui/space_view3d.py
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/object/object_ops.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_view3d/view3d_ops.c
source/blender/windowmanager/intern/wm_operators.c

index c17b089..a401328 100644 (file)
@@ -3394,6 +3394,28 @@ class VIEW3D_MT_edit_gpencil_interpolate(Menu):
         layout.operator("gpencil.interpolate_sequence", text="Sequence")
 
 
+class VIEW3D_PIE_object_mode(Menu):
+    bl_label = "Mode"
+
+    def draw(self, context):
+        layout = self.layout
+
+        pie = layout.menu_pie()
+        pie.operator_enum("OBJECT_OT_mode_set", "mode")
+
+
+class VIEW3D_PIE_view(Menu):
+    bl_label = "View"
+    bl_idname = "VIEW3D_PIE_view"
+
+    def draw(self, context):
+        layout = self.layout
+
+        pie = layout.menu_pie()
+        pie.operator_enum("VIEW3D_OT_viewnumpad", "type")
+        pie.operator("view3d.view_selected", text="View Selected", icon='ZOOM_SELECTED')
+
+
 # ********** Panel **********
 
 
@@ -4009,6 +4031,8 @@ classes = (
     VIEW3D_MT_edit_armature_delete,
     VIEW3D_MT_edit_gpencil_transform,
     VIEW3D_MT_edit_gpencil_interpolate,
+    VIEW3D_PIE_object_mode,
+    VIEW3D_PIE_view,
     VIEW3D_PT_grease_pencil,
     VIEW3D_PT_grease_pencil_palettecolor,
     VIEW3D_PT_view3d_properties,
index b3c507a..f5c5a85 100644 (file)
@@ -335,6 +335,24 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        RNA_boolean_set(kmi->ptr, "vertex_only", true);
 
        /* selecting */
+
+       kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", ONEKEY, KM_PRESS, 0, 0);
+       RNA_enum_set(kmi->ptr, "type", SCE_SELECT_VERTEX);
+       kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", TWOKEY, KM_PRESS, 0, 0);
+       RNA_enum_set(kmi->ptr, "type", SCE_SELECT_EDGE);
+       kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", THREEKEY, KM_PRESS, 0, 0);
+       RNA_enum_set(kmi->ptr, "type", SCE_SELECT_FACE);
+
+       kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", ONEKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_enum_set(kmi->ptr, "type", SCE_SELECT_VERTEX);
+       RNA_boolean_set(kmi->ptr, "use_extend", true);
+       kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", TWOKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_enum_set(kmi->ptr, "type", SCE_SELECT_EDGE);
+       RNA_boolean_set(kmi->ptr, "use_extend", true);
+       kmi = WM_keymap_add_item(keymap, "MESH_OT_select_mode", THREEKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_enum_set(kmi->ptr, "type", SCE_SELECT_FACE);
+       RNA_boolean_set(kmi->ptr, "use_extend", true);
+
        /* standard mouse selection goes via space_view3d */
        kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
        RNA_boolean_set(kmi->ptr, "extend", false);
index 915395f..af57282 100644 (file)
@@ -289,23 +289,11 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        keymap = WM_keymap_find(keyconf, "Object Non-modal", 0, 0);
 
        /* modes */
-       {
-               short key_mode_pair[][2] = {
-                       {ONEKEY, OB_MODE_OBJECT},
-                       {TWOKEY, OB_MODE_EDIT},
-                       {THREEKEY, OB_MODE_POSE},
-                       {THREEKEY, OB_MODE_WEIGHT_PAINT},
-                       {FOURKEY, OB_MODE_VERTEX_PAINT},
-                       {FIVEKEY, OB_MODE_TEXTURE_PAINT},
-                       {SIXKEY, OB_MODE_SCULPT},
-                       {SEVENKEY, OB_MODE_PARTICLE_EDIT},
-               };
-
-               for (uint i = 0; i < ARRAY_SIZE(key_mode_pair); i++) {
-                       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set_or_submode", key_mode_pair[i][0], KM_PRESS, 0, 0);
-                       RNA_enum_set(kmi->ptr, "mode", key_mode_pair[i][1]);
-               }
-       }
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_RELEASE, 0, 0);
+       RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT);
+       RNA_boolean_set(kmi->ptr, "toggle", true);
+
+       kmi = WM_keymap_add_menu_pie(keymap, "VIEW3D_PIE_object_mode", TABKEY, KM_CLICK_DRAG, 0, 0);
 
        WM_keymap_add_item(keymap, "OBJECT_OT_origin_set", CKEY, KM_PRESS, KM_ALT | KM_SHIFT | KM_CTRL, 0);
 
index f6bd238..913db10 100644 (file)
@@ -4808,7 +4808,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
 
        /* tests */
        WM_keymap_add_item(keymap, "SCREEN_OT_region_quadview", QKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
-       WM_keymap_verify_item(keymap, "SCREEN_OT_repeat_history", F3KEY, KM_PRESS, 0, 0);
+       WM_keymap_verify_item(keymap, "SCREEN_OT_repeat_history", RKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
        WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_verify_item(keymap, "SCREEN_OT_region_flip", F5KEY, KM_PRESS, 0, 0);
        WM_keymap_verify_item(keymap, "SCREEN_OT_redo_last", F6KEY, KM_PRESS, 0, 0);
index c143ebb..80224e6 100644 (file)
@@ -298,7 +298,7 @@ static void image_keymap(struct wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "IMAGE_OT_reload", RKEY, KM_PRESS, KM_ALT, 0);
        WM_keymap_add_item(keymap, "IMAGE_OT_read_viewlayers", RKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "IMAGE_OT_save", SKEY, KM_PRESS, KM_ALT, 0);
-       WM_keymap_add_item(keymap, "IMAGE_OT_save_as", F3KEY, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "IMAGE_OT_save_as", SKEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "IMAGE_OT_properties", NKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "IMAGE_OT_toolshelf", TKEY, KM_PRESS, 0, 0);
 
index 3b800c2..5f55e67 100644 (file)
@@ -301,6 +301,8 @@ void view3d_keymap(wmKeyConfig *keyconf)
        kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_view_all", CKEY, KM_PRESS, KM_SHIFT, 0);
        RNA_boolean_set(kmi->ptr, "center", true);
 
+       WM_keymap_add_menu_pie(keymap, "VIEW3D_PIE_view", ACCENTGRAVEKEY, KM_PRESS, 0, 0);
+
        /* numpad view hotkeys*/
        RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD0, KM_PRESS, 0, 0)->ptr, "type", RV3D_VIEW_CAMERA);
        RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, 0, 0)->ptr, "type", RV3D_VIEW_FRONT);
index a61a7dd..a71c9c4 100644 (file)
@@ -3989,7 +3989,7 @@ void wm_window_keymap(wmKeyConfig *keyconf)
 
        /* menus that can be accessed anywhere in blender */
 
-       WM_keymap_verify_item(keymap, "WM_OT_search_menu", TABKEY, KM_PRESS, 0, 0);
+       WM_keymap_verify_item(keymap, "WM_OT_search_menu", F3KEY, KM_PRESS, 0, 0);
 
 #ifdef WITH_INPUT_NDOF
        WM_keymap_add_menu(keymap, "USERPREF_MT_ndof_settings", NDOF_BUTTON_MENU, KM_PRESS, 0, 0);