diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-10-19 16:27:40 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-10-19 16:27:40 +0400 |
commit | 520e805dadc0b1dce10e9fb5efa1a22bbadcf2a4 (patch) | |
tree | 9f1cfb1a68fa503a686d690a5664ac58ca41f63e /source | |
parent | 666b480830a978044a7e36e5db0deff919c388a9 (diff) |
Make the sequencer Ctrl+RMB select all strips on the mouse side of the playhead (just like the dope sheet).
Changes how selecting linked left/right work since this conflicts. rather then Ctrl for left and Alt for right, Just use Alt and select the side based on the handle selected.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_ops.c | 15 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_select.c | 45 |
2 files changed, 48 insertions, 12 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index eedbab779c0..58ac143d349 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -146,6 +146,9 @@ void sequencer_keymap(wmKeyConfig *keyconf) /* Mouse selection, a bit verbose :/ */ WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", 1); + + /* 2.4x method, now use Alt for handles and select the side based on which handle was selected */ + /* RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0)->ptr, "linked_left", 1); RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "linked_right", 1); @@ -165,8 +168,18 @@ void sequencer_keymap(wmKeyConfig *keyconf) kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0); RNA_boolean_set(kmi->ptr, "extend", 1); RNA_boolean_set(kmi->ptr, "linked_right", 1); + */ - + /* 2.5 method, Alt and use selected handle */ + RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "linked_handle", 1); + + kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0); + RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "linked_handle", 1); + + /* match action editor */ + RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0)->ptr, "left_right", 1); + /* adjusted since 2.4 */ WM_keymap_add_item(keymap, "SEQUENCER_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0); diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index e03cb6ddc94..fc33dc139b6 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -291,8 +291,8 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, FALSE); short extend= RNA_boolean_get(op->ptr, "extend"); - short linked_left= RNA_boolean_get(op->ptr, "linked_left"); - short linked_right= RNA_boolean_get(op->ptr, "linked_right"); + short linked_handle= RNA_boolean_get(op->ptr, "linked_handle"); + short left_right= RNA_boolean_get(op->ptr, "left_right"); short mval[2]; @@ -323,12 +323,34 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) marker->flag |= SELECT; } + } else if (left_right) { + /* use different logic for this */ + float x; + deselect_all_seq(scene); + UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, NULL); + + SEQP_BEGIN(ed, seq) { + if (x < CFRA) { + if(seq->enddisp < CFRA) { + seq->flag |= SELECT; + recurs_sel_seq(seq); + } + } + else { + if(seq->startdisp > CFRA) { + seq->flag |= SELECT; + recurs_sel_seq(seq); + } + } + + } + SEQ_END } else { seq= find_nearest_seq(scene, v2d, &hand, mval); act_orig= ed->act_seq; - if(extend == 0 && linked_left==0 && linked_right==0) + if(extend == 0 && linked_handle==0) deselect_all_seq(scene); if(seq) { @@ -348,7 +370,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) if(extend && (seq->flag & SELECT) && ed->act_seq == act_orig ) { switch(hand) { case SEQ_SIDE_NONE: - if (linked_left==0 && linked_right==0) + if (linked_handle==0) seq->flag &= SEQ_DESEL; break; case SEQ_SIDE_LEFT: @@ -365,19 +387,19 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) if(hand==SEQ_SIDE_RIGHT) seq->flag |= SEQ_RIGHTSEL; } - /* On Ctrl-Alt selection, select the strip and bordering handles */ - if (linked_left && linked_right) { + /* On Alt selection, select the strip and bordering handles */ + if (linked_handle && !ELEM(hand, SEQ_SIDE_LEFT, SEQ_SIDE_RIGHT)) { if(extend==0) deselect_all_seq(scene); seq->flag |= SELECT; select_surrounding_handles(scene, seq); } - else if ((linked_left || linked_right) && (seq->flag & SELECT)) { + else if (linked_handle && ELEM(hand, SEQ_SIDE_LEFT, SEQ_SIDE_RIGHT) && (seq->flag & SELECT)) { /* * First click selects adjacent handles on that side. * Second click selects all strips in that direction. * If there are no adjacent strips, it just selects all in that direction. */ - sel_side= linked_left ? SEQ_SIDE_LEFT:SEQ_SIDE_RIGHT; + sel_side= hand; neighbor=find_neighboring_sequence(scene, seq, sel_side, -1); if (neighbor) { switch (sel_side) { @@ -461,9 +483,10 @@ void SEQUENCER_OT_select(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "extend", 0, "Extend", "extend the selection"); - RNA_def_boolean(ot->srna, "linked_left", 0, "Linked Left", "Select strips to the left of the active strip"); - RNA_def_boolean(ot->srna, "linked_right", 0, "Linked Right", "Select strips to the right of the active strip"); + RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection."); + RNA_def_boolean(ot->srna, "linked_handle", 0, "Linked Handle", "Select handles next to the active strip."); + /* for animation this is an enum but atm having an enum isnt useful for us */ + RNA_def_boolean(ot->srna, "left_right", 0, "Left/Right", "select based on the frame side the cursor is on."); } |