fix for sequencer transform with effects strips where the effects could be moved...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 7 Jun 2011 16:47:25 +0000 (16:47 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 7 Jun 2011 16:47:25 +0000 (16:47 +0000)
source/blender/editors/transform/transform_conversions.c

index c7699f7249cf287803d51948e040b0d1fce31874..593ab7b61e9c111f5f3806f434715ef5886757ac 100644 (file)
@@ -4016,6 +4016,7 @@ static void freeSeqData(TransInfo *t)
                                }
 
                                if(overlap) {
+                                       int has_effect= 0;
                                        for(seq= seqbasep->first; seq; seq= seq->next)
                                                seq->tmp= NULL;
 
@@ -4024,12 +4025,48 @@ static void freeSeqData(TransInfo *t)
                                        for(a=0; a<t->total; a++, td++) {
                                                seq= ((TransDataSeq *)td->extra)->seq;
                                                if ((seq != seq_prev)) {
-                                                       /* Tag seq with a non zero value, used by shuffle_seq_time to identify the ones to shuffle */
-                                                       seq->tmp= (void*)1;
+                                                       /* check effects strips, we cant change their time */
+                                                       if((seq->type & SEQ_EFFECT) && seq->seq1) {
+                                                               // shuffle_seq(seqbasep, seq, t->scene);
+                                                               has_effect= TRUE;
+                                                       }
+                                                       else {
+                                                               /* Tag seq with a non zero value, used by shuffle_seq_time to identify the ones to shuffle */
+                                                               seq->tmp= (void*)1;
+                                                       }
                                                }
                                        }
 
                                        shuffle_seq_time(seqbasep, t->scene);
+
+                                       if(has_effect) {
+                                               /* update effects strips based on strips just moved in time */
+                                               td= t->data;
+                                               seq_prev= NULL;
+                                               for(a=0; a<t->total; a++, td++) {
+                                                       seq= ((TransDataSeq *)td->extra)->seq;
+                                                       if ((seq != seq_prev)) {
+                                                               if((seq->type & SEQ_EFFECT) && seq->seq1) {
+                                                                       calc_sequence(t->scene, seq);
+                                                               }
+                                                       }
+                                               }
+
+                                               /* now if any effects _still_ overlap, we need to move them up */
+                                               td= t->data;
+                                               seq_prev= NULL;
+                                               for(a=0; a<t->total; a++, td++) {
+                                                       seq= ((TransDataSeq *)td->extra)->seq;
+                                                       if ((seq != seq_prev)) {
+                                                               if((seq->type & SEQ_EFFECT) && seq->seq1) {
+                                                                       if(seq_test_overlap(seqbasep, seq)) {
+                                                                               shuffle_seq(seqbasep, seq, t->scene);
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                               /* done with effects */
+                                       }
                                }
                        }
 #endif