diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-09-05 04:56:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-09-05 05:13:12 +0300 |
commit | bb6a94fa7b28390ea8c22a6026562b0ab6685f92 (patch) | |
tree | 1f367af3d7b5e05475e369ed24fc805321aefe9d /source | |
parent | 19c7e499e19aadc7d6d7831bd6924de568cd957d (diff) |
Fix VSE cut both-sides option
Was ignoring the option, using the mouse in all cases.
D3671 by @ISS w/ edits.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 5b8f2ae7067..cae626cd1f4 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -101,8 +101,11 @@ EnumPropertyItem sequencer_prop_effect_types[] = { /* mute operator */ +#define SEQ_SIDE_MOUSE -1 + EnumPropertyItem prop_side_types[] = { - {SEQ_SIDE_LEFT, "LEFT", 0, "Left", ""}, + {SEQ_SIDE_MOUSE, "MOUSE", 0, "Mouse position", "" }, + {SEQ_SIDE_LEFT, "LEFT", 0, "Left", "" }, {SEQ_SIDE_RIGHT, "RIGHT", 0, "Right", ""}, {SEQ_SIDE_BOTH, "BOTH", 0, "Both", ""}, {0, NULL, 0, NULL, NULL} @@ -2138,16 +2141,20 @@ static int sequencer_cut_invoke(bContext *C, wmOperator *op, const wmEvent *even Scene *scene = CTX_data_scene(C); View2D *v2d = UI_view2d_fromcontext(C); - int cut_side = SEQ_SIDE_BOTH; + int cut_side = RNA_enum_get(op->ptr, "side"); int cut_frame = CFRA; - if (ED_operator_sequencer_active(C) && v2d) - cut_side = mouse_frame_side(v2d, event->mval[0], cut_frame); - + if (cut_side == SEQ_SIDE_MOUSE) { + if (ED_operator_sequencer_active(C) && v2d) { + cut_side = mouse_frame_side(v2d, event->mval[0], cut_frame); + } + else { + cut_side = SEQ_SIDE_BOTH; + } + } RNA_int_set(op->ptr, "frame", cut_frame); RNA_enum_set(op->ptr, "side", cut_side); /*RNA_enum_set(op->ptr, "type", cut_hard); */ /*This type is set from the key shortcut */ - return sequencer_cut_exec(C, op); } @@ -2167,11 +2174,15 @@ void SEQUENCER_OT_cut(struct wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + PropertyRNA *prop; RNA_def_int(ot->srna, "frame", 0, INT_MIN, INT_MAX, "Frame", "Frame where selected strips will be cut", INT_MIN, INT_MAX); RNA_def_enum(ot->srna, "type", prop_cut_types, SEQ_CUT_SOFT, "Type", "The type of cut operation to perform on strips"); - RNA_def_enum(ot->srna, "side", prop_side_types, SEQ_SIDE_BOTH, "Side", "The side that remains selected after cutting"); + prop = RNA_def_enum(ot->srna, "side", prop_side_types, SEQ_SIDE_MOUSE, "Side", "The side that remains selected after cutting"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE); } +#undef SEQ_SIDE_MOUSE + /* duplicate operator */ static int apply_unique_name_cb(Sequence *seq, void *arg_pt) { |