diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-07 12:33:57 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-07 12:34:10 +0300 |
commit | 219e2f976d077c16c28d72a2f6763c01230c5bf8 (patch) | |
tree | ba40e7f79947dd11cae4a08ed813f920c00fbfd7 /source/blender/editors/space_action | |
parent | e52e0c83d717b46afcce36b23e3f6b32f5cb535b (diff) |
Tool System: use set/add/subtract for all box select operators
Diffstat (limited to 'source/blender/editors/space_action')
-rw-r--r-- | source/blender/editors/space_action/action_select.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 0d9c3808b55..ed63cb523de 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -333,29 +333,22 @@ static int actkeys_box_select_exec(bContext *C, wmOperator *op) { bAnimContext ac; rcti rect; - short mode = 0, selectmode = 0; - const bool select = !RNA_boolean_get(op->ptr, "deselect"); - const bool extend = RNA_boolean_get(op->ptr, "extend"); + short mode = 0; /* get editor data */ - if (ANIM_animdata_get_context(C, &ac) == 0) + if (ANIM_animdata_get_context(C, &ac) == 0) { return OPERATOR_CANCELLED; + } - /* clear all selection if not extending selection */ - if (!extend) { + const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode"); + const int selectmode = (sel_op != SEL_OP_SUB) ? SELECT_ADD : SELECT_SUBTRACT; + if (SEL_OP_USE_PRE_DESELECT(sel_op)) { deselect_action_keys(&ac, 1, SELECT_SUBTRACT); } /* get settings from operator */ WM_operator_properties_border_to_rcti(op, &rect); - if (select) { - selectmode = SELECT_ADD; - } - else { - selectmode = SELECT_SUBTRACT; - } - /* selection 'mode' depends on whether box_select region only matters on one axis */ if (RNA_boolean_get(op->ptr, "axis_range")) { /* mode depends on which axis of the range is larger to determine which axis to use @@ -399,9 +392,11 @@ void ACTION_OT_select_box(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* rna */ - WM_operator_properties_gesture_box_select(ot); - ot->prop = RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", ""); + + /* properties */ + WM_operator_properties_gesture_box(ot); + WM_operator_properties_select_operation_simple(ot); } /* ******************** Region Select Operators ***************************** */ |