[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13312] trunk/blender/source/blender: draw muted strips faded.

Campbell Barton ideasman42 at gmail.com
Sun Jan 20 21:09:06 CET 2008


Revision: 13312
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13312
Author:   campbellbarton
Date:     2008-01-20 21:09:06 +0100 (Sun, 20 Jan 2008)

Log Message:
-----------
draw muted strips faded. hkey added alt+hkey to mute and un-mute strips, Mkey is used for metastrips. would be nice to make this similar to object mode restrict render option.

Modified Paths:
--------------
    trunk/blender/source/blender/include/BIF_editseq.h
    trunk/blender/source/blender/src/drawseq.c
    trunk/blender/source/blender/src/editseq.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-01-20 18:55:56 UTC (rev 13311)
+++ trunk/blender/source/blender/include/BIF_editseq.h	2008-01-20 20:09:06 UTC (rev 13312)
@@ -62,6 +62,7 @@
 void				no_gaps(void);
 void				seq_snap(short event);
 void				seq_snap_menu(void);
+void				seq_mute_sel( int mute );
 void				set_filter_seq(void);
 void				swap_select_seq(void);
 void				touch_seq_files(void);

Modified: trunk/blender/source/blender/src/drawseq.c
===================================================================
--- trunk/blender/source/blender/src/drawseq.c	2008-01-20 18:55:56 UTC (rev 13311)
+++ trunk/blender/source/blender/src/drawseq.c	2008-01-20 20:09:06 UTC (rev 13312)
@@ -92,6 +92,24 @@
 #define SEQ_STRIP_OFSBOTTOM		0.2
 #define SEQ_STRIP_OFSTOP		0.8
 
+static GLubyte halftone[] = {
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
+			0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55};
+
 /* Note, Dont use WHILE_SEQ while drawing! - it messes up transform, - Campbell */
 
 int no_rightbox=0, no_leftbox= 0;
@@ -220,6 +238,14 @@
 
 	dx= (x2-x1)/nr;
 
+	if (seqm->flag & SEQ_MUTE) {
+		glEnable(GL_POLYGON_STIPPLE);
+		glPolygonStipple(halftone);
+		
+		glEnable(GL_LINE_STIPPLE);
+		glLineStipple(1, 0x8888);
+	}
+	
 	for (seq= seqm->seqbase.first; seq; seq= seq->next) {
 		get_seq_color3ubv(seq, col);
 		
@@ -234,6 +260,11 @@
 		
 		x1+= dx;
 	}
+	
+	if (seqm->flag & SEQ_MUTE) {
+		glDisable(GL_POLYGON_STIPPLE);
+		glDisable(GL_LINE_STIPPLE);
+	}
 }
 
 static void drawseqwave(Sequence *seq, float x1, float y1, float x2, float y2, int winx)
@@ -603,6 +634,11 @@
 {
 	float ymid1, ymid2;
 	
+	if (seq->flag & SEQ_MUTE) {
+		glEnable(GL_POLYGON_STIPPLE);
+		glPolygonStipple(halftone);
+	}
+	
 	ymid1 = (y2-y1)*0.25 + y1;
 	ymid2 = (y2-y1)*0.65 + y1;
 	
@@ -644,6 +680,9 @@
 	
 	glEnd();
 	
+	if (seq->flag & SEQ_MUTE) {
+		glDisable(GL_POLYGON_STIPPLE);
+	}
 }
 
 /*
@@ -701,9 +740,18 @@
 	BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, outline_tint);
 	
 	glColor3ubv((GLubyte *)col);
+	
+	if (seq->flag & SEQ_MUTE) {
+		glEnable(GL_LINE_STIPPLE);
+		glLineStipple(1, 0x8888);
+	}
+	
 	gl_round_box_shade(GL_LINE_LOOP, x1, y1, x2, y2, 0.0, 0.1, 0.0);
-
 	
+	if (seq->flag & SEQ_MUTE) {
+		glDisable(GL_LINE_STIPPLE);
+	}
+	
 	/* calculate if seq is long enough to print a name */
 	x1= seq->startdisp+seq->handsize;
 	x2= seq->enddisp-seq->handsize;

Modified: trunk/blender/source/blender/src/editseq.c
===================================================================
--- trunk/blender/source/blender/src/editseq.c	2008-01-20 18:55:56 UTC (rev 13311)
+++ trunk/blender/source/blender/src/editseq.c	2008-01-20 20:09:06 UTC (rev 13312)
@@ -3685,6 +3685,23 @@
 	allqueue(REDRAWSEQ, 0);
 }
 
+void seq_mute_sel(int mute) {
+	Editing *ed;
+	Sequence *seq;
+	
+	ed= G.scene->ed;
+	if(!ed) return NULL;
+	
+	for(seq= ed->seqbasep->first; seq; seq= seq->next) {
+		if ((seq->flag & SELECT) && (seq->flag & SEQ_LOCK)==0) {
+			if (mute) seq->flag |= SEQ_MUTE;
+			else seq->flag &= ~SEQ_MUTE;
+		}
+	}
+	BIF_undo_push(mute?"Mute Strips, Sequencer":"UnMute Strips, Sequencer");
+	allqueue(REDRAWSEQ, 0);
+}
+
 void borderselect_seq(void)
 {
 	Sequence *seq;

Modified: trunk/blender/source/blender/src/space.c
===================================================================
--- trunk/blender/source/blender/src/space.c	2008-01-20 18:55:56 UTC (rev 13311)
+++ trunk/blender/source/blender/src/space.c	2008-01-20 20:09:06 UTC (rev 13312)
@@ -4798,6 +4798,13 @@
                                doredraw= 1;
                        }
                        break;
+		case HKEY: /* hide==mute? - not that nice but MKey us used for meta :/ */
+			if((G.qual==0)) {
+				seq_mute_sel(1);
+			} else if((G.qual==LR_ALTKEY)) {
+				seq_mute_sel(0);
+			}
+			break;
 		case XKEY:
 		case DELKEY:
 			if(G.qual==0) {





More information about the Bf-blender-cvs mailing list