Enables sequencer ipos for effect plugins and audio-tracks
authorPeter Schlaile <peter@schlaile.de>
Sun, 5 Feb 2006 19:13:44 +0000 (19:13 +0000)
committerPeter Schlaile <peter@schlaile.de>
Sun, 5 Feb 2006 19:13:44 +0000 (19:13 +0000)
to be locked to frames instead of the range from 0-100.
Comes very handy on long timelines...

source/blender/blenkernel/intern/ipo.c

index b6b4f9a3bcbe1c46c97953fb9358c2008c5c8219..13821ea37126be0a7570924f73f7381eb5e4203a 100644 (file)
@@ -1986,9 +1986,15 @@ void do_seq_ipo(Sequence *seq)
        /* seq_ipo has an exception: calc both fields immediately */
        
        if(seq->ipo) {
-               ctime= frame_to_float(G.scene->r.cfra - seq->startdisp);
-               div= (seq->enddisp - seq->startdisp)/100.0f;
-               if(div==0.0) return;
+               if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
+                       ctime = frame_to_float(G.scene->r.cfra);
+                       div = 1.0;
+               } else {
+                       ctime= frame_to_float(G.scene->r.cfra 
+                                             - seq->startdisp);
+                       div= (seq->enddisp - seq->startdisp)/100.0f;
+                       if(div==0.0) return;
+               }
                
                /* 2nd field */
                calc_ipo(seq->ipo, (ctime+0.5f)/div);
@@ -2099,8 +2105,10 @@ void do_all_data_ipos()
        if (ed) {
                seq= ed->seqbasep->first;
                while(seq) {
-                       if ((seq->type == SEQ_SOUND) && (seq->ipo) && 
-                               (seq->startdisp<=G.scene->r.cfra+2) && (seq->enddisp>G.scene->r.cfra)) 
+                       if ((seq->type == SEQ_RAM_SOUND
+                            || seq->type == SEQ_HD_SOUND) && (seq->ipo) && 
+                               (seq->startdisp<=G.scene->r.cfra+2) && 
+                           (seq->enddisp>G.scene->r.cfra)) 
                                        do_seq_ipo(seq);
                        seq= seq->next;
                }