[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13840] trunk/blender/source/blender: == Sequencer ==

Peter Schlaile peter at schlaile.de
Sun Feb 24 13:12:05 CET 2008


Revision: 13840
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13840
Author:   schlaile
Date:     2008-02-24 13:12:05 +0100 (Sun, 24 Feb 2008)

Log Message:
-----------
== Sequencer ==

Fixes a lot of small things:
* zoom in/out in preview is more fine grained (use SHIFT)
* zebra scopes don't try to draw the border and fail
* lock/unlock now locks/unlocks all selected strips
* fix redraw problems of panel on lock/unlock
* buttons-panel is redrawn on translate, so that position information is shown
* added lock / hide to Strip-Menu
* fixed small drawing problems in header

TODO: find a good key for lock / unlock (Shift-L | Alt-Shift-L isn't that nice
      to press...)

Modified Paths:
--------------
    trunk/blender/source/blender/include/BIF_editseq.h
    trunk/blender/source/blender/makesdna/DNA_space_types.h
    trunk/blender/source/blender/src/editseq.c
    trunk/blender/source/blender/src/header_seq.c
    trunk/blender/source/blender/src/seqscopes.c
    trunk/blender/source/blender/src/space.c

Modified: trunk/blender/source/blender/include/BIF_editseq.h
===================================================================
--- trunk/blender/source/blender/include/BIF_editseq.h	2008-02-24 12:02:58 UTC (rev 13839)
+++ trunk/blender/source/blender/include/BIF_editseq.h	2008-02-24 12:12:05 UTC (rev 13840)
@@ -63,6 +63,7 @@
 void				seq_snap(short event);
 void				seq_snap_menu(void);
 void				seq_mute_sel( int mute );
+void                            seq_lock_sel(int lock);
 void				set_filter_seq(void);
 void				swap_select_seq(void);
 void				touch_seq_files(void);

Modified: trunk/blender/source/blender/makesdna/DNA_space_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_space_types.h	2008-02-24 12:02:58 UTC (rev 13839)
+++ trunk/blender/source/blender/makesdna/DNA_space_types.h	2008-02-24 12:12:05 UTC (rev 13840)
@@ -148,11 +148,11 @@
 	View2D v2d;
 	
 	float xof, yof;	/* offset for drawing the image preview */
-	short mainb, zoom;
+	short mainb, pad;
 	short chanshown;
 	short zebra;
 	int flag;
-	int pad;
+	float zoom;
 } SpaceSeq;
 
 typedef struct SpaceFile {

Modified: trunk/blender/source/blender/src/editseq.c
===================================================================
--- trunk/blender/source/blender/src/editseq.c	2008-02-24 12:02:58 UTC (rev 13839)
+++ trunk/blender/source/blender/src/editseq.c	2008-02-24 12:12:05 UTC (rev 13840)
@@ -896,8 +896,7 @@
 
 			recurs_sel_seq(seq);
 		}
-		allqueue(REDRAWBUTSSCENE, 0);
-		force_draw(0);
+		force_draw_plus(SPACE_BUTS, 0);
 
 		if(get_last_seq()) allqueue(REDRAWIPO, 0);
 		BIF_undo_push("Select Strips, Sequencer");
@@ -3298,7 +3297,7 @@
 			/* warning, drawing should NEVER use WHILE_SEQ,
 			if it does the seq->depth value will be messed up and
 			overlap checks with metastrips will give incorrect results */
-			force_draw(0);
+			force_draw_plus(SPACE_BUTS, 0);
 			
 		}
 		else BIF_wait_for_statechange();
@@ -3678,6 +3677,23 @@
 	allqueue(REDRAWSEQ, 0);
 }
 
+void seq_lock_sel(int lock) {
+	Editing *ed;
+	Sequence *seq;
+	
+	ed= G.scene->ed;
+	if(!ed) return;
+	
+	for(seq= ed->seqbasep->first; seq; seq= seq->next) {
+		if ((seq->flag & SELECT)) {
+			if (lock) seq->flag |= SEQ_LOCK;
+			else seq->flag &= ~SEQ_LOCK;
+		}
+	}
+	BIF_undo_push(lock?"Lock Strips, Sequencer":"Unlock Strips, Sequencer");
+	allqueue(REDRAWSEQ, 0);
+}
+
 void borderselect_seq(void)
 {
 	Sequence *seq;

Modified: trunk/blender/source/blender/src/header_seq.c
===================================================================
--- trunk/blender/source/blender/src/header_seq.c	2008-02-24 12:02:58 UTC (rev 13839)
+++ trunk/blender/source/blender/src/header_seq.c	2008-02-24 12:12:05 UTC (rev 13840)
@@ -434,6 +434,18 @@
 	case 17:
 		reload_sequence();
 		break;
+	case 18:
+		seq_lock_sel(1);
+		break;
+	case 19:
+		seq_lock_sel(0);
+		break;
+	case 20:
+		seq_mute_sel(1);
+		break;
+	case 21:
+		seq_mute_sel(0);
+		break;
 	}
 }
 
@@ -501,6 +513,11 @@
 	
 	uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
 	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reload Strip Data...|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 17, "");
+	uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lock Strips...|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 18, "");
+	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unlock Strips...|Alt-Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 19, "");
+	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mute Strips...|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 20, "");
+	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unmute Strips...|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 21, "");
 	
 
 	if(curarea->headertype==HEADERTOP) {
@@ -745,7 +762,7 @@
 		/* ZOOM and BORDER */
 		xco+= 8;
 		uiBlockBeginAlign(block);
-		uiDefIconButI(block, TOG, B_VIEW2DZOOM, ICON_VIEWZOOM,	xco,0,XIC,YIC, &viewmovetemp, 0, 0, 0, 0, "Zooms view in and out (Ctrl MiddleMouse)");
+		uiDefIconButI(block, TOG, B_VIEW2DZOOM, ICON_VIEWZOOM,	xco+=XIC,0,XIC,YIC, &viewmovetemp, 0, 0, 0, 0, "Zooms view in and out (Ctrl MiddleMouse)");
 		uiDefIconBut(block, BUT, B_IPOBORDER, ICON_BORDERMOVE,	xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms view to fit area");
 		uiBlockEndAlign(block);
 

Modified: trunk/blender/source/blender/src/seqscopes.c
===================================================================
--- trunk/blender/source/blender/src/seqscopes.c	2008-02-24 12:02:58 UTC (rev 13839)
+++ trunk/blender/source/blender/src/seqscopes.c	2008-02-24 12:12:05 UTC (rev 13840)
@@ -373,10 +373,7 @@
 			unsigned char a = *p++;
 
 			if (r >= limit || g >= limit || b >= limit) {
-				if (r == limit 
-				    || g == limit 
-				    || b == limit 
-				    || (((x + y) & 0x08) != 0)) {
+				if (((x + y) & 0x08) != 0) {
 					r = 255 - r;
 					g = 255 - g;
 					b = 255 - b;
@@ -408,13 +405,10 @@
 			float a = *p++;
 
 			if (r >= limit || g >= limit || b >= limit) {
-				if (r == limit 
-				    || g == limit 
-				    || b == limit 
-				    || (((x + y) & 0x08) != 0)) {
-					r = 1.0 - r;
-					g = 1.0 - g;
-					b = 1.0 - b;
+				if (((x + y) & 0x08) != 0) {
+					r = -r;
+					g = -g;
+					b = -b;
 				}
 			}
 

Modified: trunk/blender/source/blender/src/space.c
===================================================================
--- trunk/blender/source/blender/src/space.c	2008-02-24 12:02:58 UTC (rev 13839)
+++ trunk/blender/source/blender/src/space.c	2008-02-24 12:12:05 UTC (rev 13840)
@@ -4746,13 +4746,19 @@
 				select_more_seq();
 				break;
 			}
+			/* fall through */
 		case WHEELUPMOUSE:
 			if(sseq->mainb) {
-				sseq->zoom++;
-				if(sseq->zoom==-1) sseq->zoom= 1;
+				if (G.qual == LR_SHIFTKEY) {
+					sseq->zoom += 0.10;
+				} else {
+					sseq->zoom++;
+				}
+				if(sseq->zoom >= -1 && sseq->zoom < 1) {
+					sseq->zoom += 2;
+				}
 				if(sseq->zoom>8) sseq->zoom= 8;
-			}
-			else {
+			} else {
 				if((G.qual==0)) {
 					dx= 0.1154f*(v2d->cur.xmax-v2d->cur.xmin);
 					v2d->cur.xmin+= dx;
@@ -4768,13 +4774,19 @@
 				select_less_seq();
 				break;
 			}
+			/* fall through */
 		case WHEELDOWNMOUSE:
 			if(sseq->mainb) {
-				sseq->zoom--;
-				if(sseq->zoom==0) sseq->zoom= -2;
+				if (G.qual == LR_SHIFTKEY) {
+					sseq->zoom -= 0.10;
+				} else {
+					sseq->zoom--;
+				}
+				if(sseq->zoom >= -1 && sseq->zoom < 1) {
+					sseq->zoom -= 2;
+				}
 				if(sseq->zoom<-8) sseq->zoom= -8;
-			}
-			else {
+			} else {
 				if((G.qual==LR_SHIFTKEY))
 					no_gaps();
 				else if((G.qual==0)) {
@@ -4873,11 +4885,10 @@
 				select_linked_seq( 0 );
 			} else if((G.qual==LR_CTRLKEY)) { /* Cut at current frame */
 				select_linked_seq( 2 );
-			} else if ((G.qual==LR_SHIFTKEY)) {
-				if (last_seq) {
-					last_seq->flag ^= SEQ_LOCK;
-					doredraw = 1;
-				}
+			} else if (G.qual==LR_SHIFTKEY) {
+				seq_lock_sel(1);
+			} else if (G.qual==(LR_SHIFTKEY|LR_ALTKEY)) {
+				seq_lock_sel(0);
 			}
 			break;
 		case YKEY:
@@ -4892,14 +4903,13 @@
 			} else if(G.qual == 0){
 				make_meta();
 				break; /*dont redraw timeline etc */
-			} else if (G.qual==LR_SHIFTKEY) {
-				if (last_seq) {
-					last_seq->flag ^= SEQ_MUTE;
-					doredraw = 1;
-				}
-			} else if ((G.qual==(LR_CTRLKEY|LR_ALTKEY) )) {
+			} else if (G.qual == LR_SHIFTKEY) {
+				seq_mute_sel(1);
+			} else if (G.qual == (LR_SHIFTKEY|LR_ALTKEY)) {
+				seq_mute_sel(0);
+			} else if (G.qual == (LR_CTRLKEY|LR_ALTKEY)) {
 				add_marker(CFRA);
-			} else if ((G.qual==LR_CTRLKEY)) {
+			} else if (G.qual == LR_CTRLKEY) {
 				rename_marker();
 			} else {
 				break; /* do nothing */





More information about the Bf-blender-cvs mailing list