[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23952] trunk/blender/source/blender/ editors/space_sequencer: Make the sequencer Ctrl+RMB select all strips on the mouse side of the playhead (just like the dope sheet).

Campbell Barton ideasman42 at gmail.com
Mon Oct 19 14:27:40 CEST 2009


Revision: 23952
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23952
Author:   campbellbarton
Date:     2009-10-19 14:27:40 +0200 (Mon, 19 Oct 2009)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_sequencer/sequencer_ops.c
    trunk/blender/source/blender/editors/space_sequencer/sequencer_select.c

Modified: trunk/blender/source/blender/editors/space_sequencer/sequencer_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_sequencer/sequencer_ops.c	2009-10-19 12:19:19 UTC (rev 23951)
+++ trunk/blender/source/blender/editors/space_sequencer/sequencer_ops.c	2009-10-19 12:27:40 UTC (rev 23952)
@@ -146,6 +146,9 @@
 	/* 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,9 +168,19 @@
 	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);
 	

Modified: trunk/blender/source/blender/editors/space_sequencer/sequencer_select.c
===================================================================
--- trunk/blender/source/blender/editors/space_sequencer/sequencer_select.c	2009-10-19 12:19:19 UTC (rev 23951)
+++ trunk/blender/source/blender/editors/space_sequencer/sequencer_select.c	2009-10-19 12:27:40 UTC (rev 23952)
@@ -291,8 +291,8 @@
 	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 @@
 			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 @@
 			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 @@
 				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 @@
 	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.");
 }
 
 





More information about the Bf-blender-cvs mailing list