Fix T48395: Grease Pencil, pressing Ekey to sculpt don't work for left click configur...
authorJoshua Leung <aligorith@gmail.com>
Wed, 18 May 2016 05:23:16 +0000 (17:23 +1200)
committerJoshua Leung <aligorith@gmail.com>
Wed, 18 May 2016 05:23:16 +0000 (17:23 +1200)
When using Left Click select, it wasn't possible to sculpt using E+LMB.

I've changed the order of things in the keymap so that the select operator won't
end up catching and blocking all these events.

source/blender/editors/gpencil/gpencil_ops.c

index 7241d4bb632b85713d00cc6e4b7683babf411452..cf9828f81058f1cb9642ec4ed4ff2a44a8ec2e78 100644 (file)
@@ -140,6 +140,36 @@ static void ed_keymap_gpencil_editing(wmKeyConfig *keyconf)
        kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, 0, 0);
        RNA_string_set(kmi->ptr, "data_path_primary", "user_preferences.edit.grease_pencil_eraser_radius");
        
+       
+       /* Sculpting ------------------------------------- */
+       
+       /* Brush-Based Editing:
+        *   EKEY + LMB                          = Single stroke, draw immediately 
+        *        + Other Modifiers (Ctrl/Shift) = Invert, Smooth, etc.
+        *
+        * For the modal version, use D+E -> Sculpt
+        */
+       kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_brush_paint", LEFTMOUSE, KM_PRESS, 0, EKEY);
+       RNA_boolean_set(kmi->ptr, "wait_for_input", false);
+       
+       kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_brush_paint", LEFTMOUSE, KM_PRESS, KM_CTRL, EKEY);
+       RNA_boolean_set(kmi->ptr, "wait_for_input", false);
+       /*RNA_boolean_set(kmi->ptr, "use_invert", true);*/
+       
+       kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_brush_paint", LEFTMOUSE, KM_PRESS, KM_SHIFT, EKEY);
+       RNA_boolean_set(kmi->ptr, "wait_for_input", false);
+       /*RNA_boolean_set(kmi->ptr, "use_smooth", true);*/
+       
+       
+       /* Shift-FKEY = Sculpt Strength */
+       kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_string_set(kmi->ptr, "data_path_primary", "tool_settings.gpencil_sculpt.brush.strength");
+       
+       /* Ctrl-FKEY = Sculpt Brush Size */
+       kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, KM_CTRL, 0);
+       RNA_string_set(kmi->ptr, "data_path_primary", "tool_settings.gpencil_sculpt.brush.size");
+       
+       
        /* Selection ------------------------------------- */
        /* select all */
        kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_select_all", AKEY, KM_PRESS, 0, 0);
@@ -238,36 +268,6 @@ static void ed_keymap_gpencil_editing(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "GPENCIL_OT_move_to_layer", MKEY, KM_PRESS, 0, 0);
        
        
-       
-       /* Brush-Based Editing:
-        *   EKEY + LMB                          = Single stroke, draw immediately 
-        *        + Other Modifiers (Ctrl/Shift) = Invert, Smooth, etc.
-        *
-        * For the modal version, use D+E -> Sculpt
-        */
-       kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_brush_paint", LEFTMOUSE, KM_PRESS, 0, EKEY);
-       RNA_boolean_set(kmi->ptr, "wait_for_input", false);
-       
-       kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_brush_paint", LEFTMOUSE, KM_PRESS, KM_CTRL, EKEY);
-       RNA_boolean_set(kmi->ptr, "wait_for_input", false);
-       /*RNA_boolean_set(kmi->ptr, "use_invert", true);*/
-       
-       kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_brush_paint", LEFTMOUSE, KM_PRESS, KM_SHIFT, EKEY);
-       RNA_boolean_set(kmi->ptr, "wait_for_input", false);
-       /*RNA_boolean_set(kmi->ptr, "use_smooth", true);*/
-       
-       
-       /* Shift-FKEY = Sculpt Strength */
-       kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_string_set(kmi->ptr, "data_path_primary", "tool_settings.gpencil_sculpt.brush.strength");
-       
-       /* Ctrl-FKEY = Sculpt Brush Size */
-       kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, KM_CTRL, 0);
-       RNA_string_set(kmi->ptr, "data_path_primary", "tool_settings.gpencil_sculpt.brush.size");
-       
-       
-       
-       
        /* Transform Tools */
        kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_translate", GKEY, KM_PRESS, 0, 0);