Commit: 33654d77c29cd9cc7af38b87cb5db7bce58a607a
Author: Antonio Vazquez
Date:   Mon Feb 12 09:10:52 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB33654d77c29cd9cc7af38b87cb5db7bce58a607a

Remove select operator hack

This hack was used when all modes shared the same keymaps, but now it's not 
necessary.

===================================================================

M       source/blender/editors/gpencil/gpencil_ops.c
M       source/blender/editors/gpencil/gpencil_select.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_ops.c 
b/source/blender/editors/gpencil/gpencil_ops.c
index 3f0866abfd8..249ea1d5dc6 100644
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -198,9 +198,6 @@ static void ed_keymap_gpencil_selection(wmKeyMap *keymap)
        kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_select_lasso", 
EVT_TWEAK_A, KM_ANY, KM_SHIFT | KM_CTRL | KM_ALT, 0);
        RNA_boolean_set(kmi->ptr, "deselect", true);
 
-       /* normal select */
-       WM_keymap_add_item(keymap, "GPENCIL_OT_select", SELECTMOUSE, KM_PRESS, 
0, 0);
-
        kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_select", SELECTMOUSE, 
KM_PRESS, KM_SHIFT, 0);
        RNA_boolean_set(kmi->ptr, "extend", true);
        RNA_boolean_set(kmi->ptr, "toggle", true);
@@ -319,6 +316,9 @@ static void ed_keymap_gpencil_editing(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "GPENCIL_OT_interpolate", EKEY, KM_PRESS, 
KM_CTRL | KM_ALT, 0);
        WM_keymap_add_item(keymap, "GPENCIL_OT_interpolate_sequence", EKEY, 
KM_PRESS, KM_SHIFT | KM_CTRL, 0);
 
+       /* normal select */
+       WM_keymap_add_item(keymap, "GPENCIL_OT_select", SELECTMOUSE, KM_PRESS, 
0, 0);
+
        /* Selection */
        ed_keymap_gpencil_selection(keymap);
 
diff --git a/source/blender/editors/gpencil/gpencil_select.c 
b/source/blender/editors/gpencil/gpencil_select.c
index 2e924a7be0f..2567f276ef1 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -1178,21 +1178,6 @@ static int gpencil_select_exec(bContext *C, wmOperator 
*op)
        ScrArea *sa = CTX_wm_area(C);
        bGPdata *gpd = ED_gpencil_data_get_active(C);
        
-#if 0 // XXX: This is some weird hacked-on stuff... Needs careful review 
(Aligorith)
-       /* if not edit mode, can select other objects */
-       if ((sa) && (sa->spacetype == SPACE_VIEW3D)) {
-               WorkSpace *workspace = CTX_wm_workspace(C);
-               if (workspace->object_mode != OB_MODE_GPENCIL_EDIT) {
-                       return OPERATOR_PASS_THROUGH;
-               }
-       }
-
-       /* if not edit mode, the event is catched but not processed */
-       if ((!gpd) || (gpd->flag & GP_DATA_STROKE_EDITMODE) == 0) {
-               return OPERATOR_CANCELLED;
-       }
-#endif
-       
        /* "radius" is simply a threshold (screen space) to make it easier to 
test with a tolerance */
        const float radius = 0.75f * U.widget_unit;
        const int radius_squared = (int)(radius * radius);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to