Fix #129947: VSE: B to box-select on strips
d2a802d3c6 got overzealous by removing the "tweak" property which was
actually necessary to differentiate box select on click-drag vs. box
select on B. Fix by restoring the tweak property for everything but
preview keymap items (where it doesn't actually do anything).
Main reason this happened is because the original description was a bit
too cryptic, so update it to be clearer.
Pull Request: https://projects.blender.org/blender/blender/pulls/130015
This commit is contained in:
committed by
John Kiril Swenson
parent
03d31a3717
commit
8bbe0bc838
@@ -2956,13 +2956,13 @@ def km_sequencer(params):
|
||||
{"properties": [("extend", True)]}),
|
||||
("sequencer.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True}, None),
|
||||
("sequencer.select_box", {"type": params.select_mouse, "value": 'CLICK_DRAG'},
|
||||
{"properties": [("mode", 'SET')]}),
|
||||
{"properties": [("tweak", True), ("mode", 'SET')]}),
|
||||
("sequencer.select_box", {"type": params.select_mouse, "value": 'CLICK_DRAG', "shift": True},
|
||||
{"properties": [("mode", 'ADD')]}),
|
||||
{"properties": [("tweak", True), ("mode", 'ADD')]}),
|
||||
("sequencer.select_box", {"type": params.select_mouse, "value": 'CLICK_DRAG', "ctrl": True},
|
||||
{"properties": [("mode", 'SUB')]}),
|
||||
{"properties": [("tweak", True), ("mode", 'SUB')]}),
|
||||
("sequencer.select_box", {"type": params.select_mouse, "value": 'CLICK_DRAG', "alt": True},
|
||||
{"properties": [("ignore_connections", True), ("mode", 'SET')]}),
|
||||
{"properties": [("tweak", True), ("ignore_connections", True), ("mode", 'SET')]}),
|
||||
("sequencer.select_box", {"type": 'B', "value": 'PRESS'}, None),
|
||||
("sequencer.select_box", {"type": 'B', "value": 'PRESS', "ctrl": True},
|
||||
{"properties": [("include_handles", True)]}),
|
||||
@@ -8025,7 +8025,8 @@ def km_sequencer_editor_tool_generic_select_box_timeline(params, *, fallback):
|
||||
*([] if (fallback and not params.use_fallback_tool) else _template_items_tool_select_actions_simple(
|
||||
"sequencer.select_box",
|
||||
**(params.select_tweak_event if (fallback and params.use_fallback_tool_select_mouse) else
|
||||
params.tool_tweak_event))),
|
||||
params.tool_tweak_event),
|
||||
properties=[("tweak", params.select_mouse == 'LEFTMOUSE')])),
|
||||
]},
|
||||
)
|
||||
|
||||
|
||||
@@ -1860,11 +1860,11 @@ def km_sequencer(params):
|
||||
{"properties": [("extend", True)]}),
|
||||
("sequencer.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True}, None),
|
||||
("sequencer.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'},
|
||||
{"properties": [("mode", 'SET')]}),
|
||||
{"properties": [("tweak", True), ("mode", 'SET')]}),
|
||||
("sequencer.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "shift": True},
|
||||
{"properties": [("mode", 'ADD')]}),
|
||||
{"properties": [("tweak", True), ("mode", 'ADD')]}),
|
||||
("sequencer.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "ctrl": True},
|
||||
{"properties": [("mode", 'SUB')]}),
|
||||
{"properties": [("tweak", True), ("mode", 'SUB')]}),
|
||||
("sequencer.select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}, None),
|
||||
("sequencer.slip", {"type": 'R', "value": 'PRESS'}, None),
|
||||
("wm.context_set_int", {"type": 'O', "value": 'PRESS'},
|
||||
|
||||
@@ -2179,15 +2179,19 @@ static int sequencer_box_select_invoke(bContext *C, wmOperator *op, const wmEven
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
int mval[2];
|
||||
float mouse_co[2];
|
||||
WM_event_drag_start_mval(event, region, mval);
|
||||
UI_view2d_region_to_view(v2d, mval[0], mval[1], &mouse_co[0], &mouse_co[1]);
|
||||
const bool tweak = RNA_boolean_get(op->ptr, "tweak");
|
||||
|
||||
StripSelection selection = ED_sequencer_pick_strip_and_handle(scene, v2d, mouse_co);
|
||||
if (tweak) {
|
||||
int mval[2];
|
||||
float mouse_co[2];
|
||||
WM_event_drag_start_mval(event, region, mval);
|
||||
UI_view2d_region_to_view(v2d, mval[0], mval[1], &mouse_co[0], &mouse_co[1]);
|
||||
|
||||
if (selection.seq1 != nullptr) {
|
||||
return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH;
|
||||
StripSelection selection = ED_sequencer_pick_strip_and_handle(scene, v2d, mouse_co);
|
||||
|
||||
if (selection.seq1 != nullptr) {
|
||||
return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH;
|
||||
}
|
||||
}
|
||||
|
||||
return WM_gesture_box_invoke(C, op, event);
|
||||
@@ -2217,6 +2221,14 @@ void SEQUENCER_OT_select_box(wmOperatorType *ot)
|
||||
WM_operator_properties_gesture_box(ot);
|
||||
WM_operator_properties_select_operation_simple(ot);
|
||||
|
||||
prop = RNA_def_boolean(
|
||||
ot->srna,
|
||||
"tweak",
|
||||
false,
|
||||
"Tweak",
|
||||
"Make box select pass through to sequence slide when the cursor is hovering on a strip");
|
||||
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
||||
|
||||
prop = RNA_def_boolean(
|
||||
ot->srna, "include_handles", false, "Select Handles", "Select the strips and their handles");
|
||||
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
||||
|
||||
Reference in New Issue
Block a user