diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-10-16 13:58:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-10-16 14:21:46 +0300 |
commit | 870b4b673511094cf0beaeaf07305407ccdda47a (patch) | |
tree | fb91f7c424f1971c35d537e520c519117e38f9d9 /source/blender/editors/space_view3d/view3d_select.c | |
parent | 6d8f63a8343a6c0b44318f0a856dcd0fd0206131 (diff) |
WM: refactor gestures for use as tools
Border and circle select wait for input by default.
This commit uses bool properties on the operators instead of
magic number (called "gesture_mode").
Keymaps that define 'deselect' for border/circle select
begin immediately, exiting when on button release.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_select.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 51af4c2dd5f..bd19fe8f686 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -915,7 +915,7 @@ void VIEW3D_OT_select_lasso(wmOperatorType *ot) ot->flag = OPTYPE_UNDO; /* properties */ - WM_operator_properties_gesture_lasso(ot); + WM_operator_properties_gesture_lasso_select(ot); } @@ -2137,9 +2137,9 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) /* setup view context for argument to callbacks */ view3d_set_viewcontext(C, &vc); - select = (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT); - WM_operator_properties_border_to_rcti(op, &rect); + select = !RNA_boolean_get(op->ptr, "deselect"); extend = RNA_boolean_get(op->ptr, "extend"); + WM_operator_properties_border_to_rcti(op, &rect); if (vc.obedit) { switch (vc.obedit->type) { @@ -2224,7 +2224,7 @@ void VIEW3D_OT_select_border(wmOperatorType *ot) ot->flag = OPTYPE_UNDO; /* rna */ - WM_operator_properties_gesture_border(ot, true); + WM_operator_properties_gesture_border_select(ot); } @@ -2835,8 +2835,7 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); Object *obact = CTX_data_active_object(C); const int radius = RNA_int_get(op->ptr, "radius"); - const int gesture_mode = RNA_int_get(op->ptr, "gesture_mode"); - const bool select = (gesture_mode == GESTURE_MODAL_SELECT); + const bool select = !RNA_boolean_get(op->ptr, "deselect"); const int mval[2] = {RNA_int_get(op->ptr, "x"), RNA_int_get(op->ptr, "y")}; @@ -2897,5 +2896,5 @@ void VIEW3D_OT_select_circle(wmOperatorType *ot) ot->flag = OPTYPE_UNDO; /* properties */ - WM_operator_properties_gesture_circle(ot); + WM_operator_properties_gesture_circle_select(ot); } |