Sequencer: Drag outside of sequence to initiate box select
This commit is contained in:
parent
c4e4b6872a
commit
8e125f278c
@ -2330,6 +2330,8 @@ def km_sequencer(params):
|
|||||||
("sequencer.select_linked_pick", {"type": 'L', "value": 'PRESS', "shift": True},
|
("sequencer.select_linked_pick", {"type": 'L', "value": 'PRESS', "shift": True},
|
||||||
{"properties": [("extend", True)]}),
|
{"properties": [("extend", True)]}),
|
||||||
("sequencer.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True}, None),
|
("sequencer.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True}, None),
|
||||||
|
("sequencer.select_box", {"type": params.select_tweak, "value": 'ANY'},
|
||||||
|
{"properties": [("tweak", True)]}),
|
||||||
("sequencer.select_box", {"type": 'B', "value": 'PRESS'}, None),
|
("sequencer.select_box", {"type": 'B', "value": 'PRESS'}, None),
|
||||||
("sequencer.select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}, None),
|
("sequencer.select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}, None),
|
||||||
op_menu("SEQUENCER_MT_add", {"type": 'A', "value": 'PRESS', "shift": True}),
|
op_menu("SEQUENCER_MT_add", {"type": 'A', "value": 'PRESS', "shift": True}),
|
||||||
|
@ -937,6 +937,22 @@ static int sequencer_box_select_exec(bContext *C, wmOperator *op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ****** Box Select ****** */
|
/* ****** Box Select ****** */
|
||||||
|
static int sequencer_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||||
|
{
|
||||||
|
Scene *scene = CTX_data_scene(C);
|
||||||
|
View2D *v2d = &CTX_wm_region(C)->v2d;
|
||||||
|
|
||||||
|
const bool tweak = RNA_boolean_get(op->ptr, "tweak");
|
||||||
|
|
||||||
|
int dummy;
|
||||||
|
Sequence *seq = find_nearest_seq(scene, v2d, &dummy, event->mval);
|
||||||
|
if (tweak && seq != NULL) {
|
||||||
|
return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH;
|
||||||
|
}
|
||||||
|
|
||||||
|
return WM_gesture_box_invoke(C, op, event);
|
||||||
|
}
|
||||||
|
|
||||||
void SEQUENCER_OT_select_box(wmOperatorType *ot)
|
void SEQUENCER_OT_select_box(wmOperatorType *ot)
|
||||||
{
|
{
|
||||||
/* identifiers */
|
/* identifiers */
|
||||||
@ -945,7 +961,7 @@ void SEQUENCER_OT_select_box(wmOperatorType *ot)
|
|||||||
ot->description = "Select strips using box selection";
|
ot->description = "Select strips using box selection";
|
||||||
|
|
||||||
/* api callbacks */
|
/* api callbacks */
|
||||||
ot->invoke = WM_gesture_box_invoke;
|
ot->invoke = sequencer_box_select_invoke;
|
||||||
ot->exec = sequencer_box_select_exec;
|
ot->exec = sequencer_box_select_exec;
|
||||||
ot->modal = WM_gesture_box_modal;
|
ot->modal = WM_gesture_box_modal;
|
||||||
ot->cancel = WM_gesture_box_cancel;
|
ot->cancel = WM_gesture_box_cancel;
|
||||||
@ -958,6 +974,10 @@ void SEQUENCER_OT_select_box(wmOperatorType *ot)
|
|||||||
/* properties */
|
/* properties */
|
||||||
WM_operator_properties_gesture_box(ot);
|
WM_operator_properties_gesture_box(ot);
|
||||||
WM_operator_properties_select_operation_simple(ot);
|
WM_operator_properties_select_operation_simple(ot);
|
||||||
|
|
||||||
|
PropertyRNA *prop = RNA_def_boolean(
|
||||||
|
ot->srna, "tweak", 0, "Tweak", "Operator has been activated using a tweak event");
|
||||||
|
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ****** Selected Grouped ****** */
|
/* ****** Selected Grouped ****** */
|
||||||
|
Loading…
Reference in New Issue
Block a user