[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13308] trunk/blender/source/blender: Cant use WHILE_SEQ when drawing,

Campbell Barton ideasman42 at gmail.com
Sun Jan 20 14:52:54 CET 2008


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

Log Message:
-----------
Cant use WHILE_SEQ when drawing,

drawing strips was setting the depth that would then incorrectly overlap when used with metastrips. - so metastrisp would grow when moved - showed up in peach animatic.

Now metastrips draw display differently- only immediate children are shown on the strip.

Also disabled overlap checking during transform for non zero depth strips since its not needed.

Modified Paths:
--------------
    trunk/blender/source/blender/include/BIF_editseq.h
    trunk/blender/source/blender/src/drawseq.c
    trunk/blender/source/blender/src/editseq.c

Modified: trunk/blender/source/blender/include/BIF_editseq.h
===================================================================
--- trunk/blender/source/blender/include/BIF_editseq.h	2008-01-20 08:59:06 UTC (rev 13307)
+++ trunk/blender/source/blender/include/BIF_editseq.h	2008-01-20 13:52:54 UTC (rev 13308)
@@ -103,8 +103,8 @@
 int seq_tx_check_left(struct Sequence *seq);
 int seq_tx_check_right(struct Sequence *seq);
 
-#define SEQ_DEBUG_INFO(seq) printf("seq into '%s' -- len:%i  start:%i  startstill:%i  endstill:%i  startofs:%i  endofs:%i\n",\
-		    seq->name, seq->len, seq->start, seq->startstill, seq->endstill, seq->startofs, seq->endofs)
+#define SEQ_DEBUG_INFO(seq) printf("seq into '%s' -- len:%i  start:%i  startstill:%i  endstill:%i  startofs:%i  endofs:%i depth:%i\n",\
+		    seq->name, seq->len, seq->start, seq->startstill, seq->endstill, seq->startofs, seq->endofs, seq->depth)
 
 
 #endif

Modified: trunk/blender/source/blender/src/drawseq.c
===================================================================
--- trunk/blender/source/blender/src/drawseq.c	2008-01-20 08:59:06 UTC (rev 13307)
+++ trunk/blender/source/blender/src/drawseq.c	2008-01-20 13:52:54 UTC (rev 13308)
@@ -92,6 +92,8 @@
 #define SEQ_STRIP_OFSBOTTOM		0.2
 #define SEQ_STRIP_OFSTOP		0.8
 
+/* Note, Dont use WHILE_SEQ while drawing! - it messes up transform, - Campbell */
+
 int no_rightbox=0, no_leftbox= 0;
 static void draw_seq_handle(Sequence *seq, SpaceSeq *sseq, float pixelx, short direction);
 static void draw_seq_extensions(Sequence *seq, SpaceSeq *sseq);
@@ -207,20 +209,18 @@
 
 static void drawmeta_contents(Sequence *seqm, float x1, float y1, float x2, float y2)
 {
+	/* Note, this used to use WHILE_SEQ, but it messes up the seq->depth value, (needed by transform when doing overlap checks)
+	 * so for now, just use the meta's immediate children, could be fixed but its only drawing - Campbell */
 	Sequence *seq;
 	float dx;
 	int nr;
 	char col[3];
 	
-	nr= 0;
-	WHILE_SEQ(&seqm->seqbase) {
-		nr++;
-	}
-	END_SEQ
+	nr= BLI_countlist(&seqm->seqbase);
 
 	dx= (x2-x1)/nr;
 
-	WHILE_SEQ(&seqm->seqbase) {
+	for (seq= seqm->seqbase.first; seq; seq= seq->next) {
 		get_seq_color3ubv(seq, col);
 		
 		glColor3ubv((GLubyte *)col);
@@ -234,7 +234,6 @@
 		
 		x1+= dx;
 	}
-	END_SEQ
 }
 
 static void drawseqwave(Sequence *seq, float x1, float y1, float x2, float y2, int winx)

Modified: trunk/blender/source/blender/src/editseq.c
===================================================================
--- trunk/blender/source/blender/src/editseq.c	2008-01-20 08:59:06 UTC (rev 13307)
+++ trunk/blender/source/blender/src/editseq.c	2008-01-20 13:52:54 UTC (rev 13308)
@@ -3307,7 +3307,7 @@
 
 			/* test for effect and overlap */
 			for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) {
-				if(seq->flag & SELECT && !(seq->flag & SEQ_LOCK)) {
+				if((seq->depth==0) && (seq->flag & SELECT) && !(seq->flag & SEQ_LOCK)) {
 					seq->flag &= ~SEQ_OVERLAP;
 					if( test_overlap_seq(seq) ) {
 						seq->flag |= SEQ_OVERLAP;
@@ -3319,7 +3319,9 @@
 					else if(seq->seq3 && seq->seq3->flag & SELECT) calc_sequence(seq);
 				}
 			}
-
+			/* 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);
 			
 		}





More information about the Bf-blender-cvs mailing list