sequencer
authorCampbell Barton <ideasman42@gmail.com>
Sun, 4 Jul 2010 08:49:54 +0000 (08:49 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 4 Jul 2010 08:49:54 +0000 (08:49 +0000)
- effects strips now add directly above the strips they operate on (almost always what you want)
- blend mode for new image/movie/scene/color strips is now cross: without this adjusting alpha will fade to black rather then the strip below.
- SEQ_HAS_PATH macro didnt include sound-ram or sound-hd
- meta drawing code has misleading variable names (from own commit).

source/blender/blenkernel/intern/sequencer.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/makesdna/DNA_sequence_types.h
source/blender/makesrna/intern/rna_sequencer.c

index baeff5a..d0678bc 100644 (file)
@@ -3994,6 +3994,7 @@ Sequence *sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
 
        seq = alloc_sequence(seqbasep, seq_load->start_frame, seq_load->channel);
        seq->type= SEQ_IMAGE;
+       seq->blend_mode= SEQ_CROSS; /* so alpha adjustment fade to the strip below */
        
        /* basic defaults */
        seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
@@ -4085,8 +4086,9 @@ Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
                return NULL;
 
        seq = alloc_sequence(seqbasep, seq_load->start_frame, seq_load->channel);
-
        seq->type= SEQ_MOVIE;
+       seq->blend_mode= SEQ_CROSS; /* so alpha adjustment fade to the strip below */
+
        seq->anim= an;
        seq->anim_preseek = IMB_anim_get_preseek(an);
        BLI_strncpy(seq->name+2, "Movie", SEQ_NAME_MAXSTR-2);
index cfcc3b6..36ae475 100644 (file)
@@ -213,8 +213,9 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
        }
        
        seq = alloc_sequence(ed->seqbasep, start_frame, channel);
-       
        seq->type= SEQ_SCENE;
+       seq->blend_mode= SEQ_CROSS; /* so alpha adjustment fade to the strip below */
+
        seq->scene= sce_seq;
        seq->sfra= sce_seq->r.sfra;
        
@@ -544,7 +545,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
 
        type= RNA_enum_get(op->ptr, "type");
        
-       // XXX We need unique names and move to invoke
+       // XXX move to invoke
        if(!seq_effect_find_selected(scene, NULL, type, &seq1, &seq2, &seq3, &error_msg)) {
                BKE_report(op->reports, RPT_ERROR, error_msg);
                return OPERATOR_CANCELLED;
@@ -603,6 +604,18 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
        else if (seq->type==SEQ_COLOR) {
                SolidColorVars *colvars= (SolidColorVars *)seq->effectdata;
                RNA_float_get_array(op->ptr, "color", colvars->col);
+               seq->blend_mode= SEQ_CROSS; /* so alpha adjustment fade to the strip below */
+
+       }
+
+       // XXX, this conflicts with giving a channel with invoke, perhaps we should have an active channel
+       // but for now this is much more usable
+       if(seq->seq1 || seq->seq2 || seq->seq3) {
+               int chan= MAX3( seq->seq1 ? seq->seq1->machine : 0,
+                                               seq->seq2 ? seq->seq2->machine : 0,
+                                               seq->seq3 ? seq->seq3->machine : 0);
+               if(chan < MAXSEQ)
+                       seq->machine= chan;
        }
 
        if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
index e50d9b5..e449490 100644 (file)
@@ -246,31 +246,31 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1,
 
        for (seq= seqm->seqbase.first; seq; seq= seq->next) {
                if((seq->startdisp > x2 || seq->enddisp < x1) == 0) {
-                       float ym= (seq->machine - chan_min) / (float)(chan_range) * draw_range;
+                       float y_chan= (seq->machine - chan_min) / (float)(chan_range) * draw_range;
+                       float x1_chan= seq->startdisp;
+                       float x2_chan= seq->enddisp;
+                       float y1_chan, y2_chan;
 
-                       float x1m= seq->startdisp;
-                       float x2m= seq->enddisp;
-                       float y1m, y2m;
-                       
                        if((seqm->flag & SEQ_MUTE) == 0 && (seq->flag & SEQ_MUTE))
                                drawmeta_stipple(1);
-                       
+
                        get_seq_color3ubv(scene, seq, col);
 
                        glColor4ubv((GLubyte *)col);
                        
-                       if(x1m < x1) x1m= x1;
-                       if(x2m > x2) x2m= x2;
-                       
-                       y1m= y1 + ym + (draw_height * SEQ_STRIP_OFSBOTTOM);
-                       y2m= y1 + ym + (draw_height * SEQ_STRIP_OFSTOP);
+                       /* clamp within parent sequence strip bounds */
+                       if(x1_chan < x1) x1_chan= x1;
+                       if(x2_chan > x2) x2_chan= x2;
 
-                       glRectf(x1m,  y1m, x2m,  y2m);
+                       y1_chan= y1 + y_chan + (draw_height * SEQ_STRIP_OFSBOTTOM);
+                       y2_chan= y1 + y_chan + (draw_height * SEQ_STRIP_OFSTOP);
+
+                       glRectf(x1_chan,  y1_chan, x2_chan,  y2_chan);
 
                        UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -30);
                        glColor4ubv((GLubyte *)col);
-                       fdrawbox(x1m,  y1m, x2m,  y2m);
-                       
+                       fdrawbox(x1_chan,  y1_chan, x2_chan,  y2_chan);
+
                        if((seqm->flag & SEQ_MUTE) == 0 && (seq->flag & SEQ_MUTE))
                                drawmeta_stipple(0);
                }
index 03a3b75..4530e91 100644 (file)
@@ -324,7 +324,8 @@ typedef struct SpeedControlVars {
    otherwise, you can't really blend, right :) !)
 */
 
-#define SEQ_HAS_PATH(_seq) ( (_seq)->type==SEQ_MOVIE || (_seq)->type==SEQ_IMAGE || (_seq)->type==SEQ_SOUND )
+
+#define SEQ_HAS_PATH(_seq) (ELEM5((_seq)->type, SEQ_MOVIE, SEQ_IMAGE, SEQ_SOUND, SEQ_RAM_SOUND, SEQ_HD_SOUND))
 
 #endif
 
index 4ee4fde..c7c7888 100644 (file)
@@ -308,8 +308,8 @@ static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr)
                case SEQ_MUL:
                case SEQ_OVERDROP:
                        return &RNA_EffectSequence;
-                case SEQ_MULTICAM:
-                        return &RNA_MulticamSequence;
+               case SEQ_MULTICAM:
+                       return &RNA_MulticamSequence;
                case SEQ_PLUGIN:
                        return &RNA_PluginSequence;
                case SEQ_WIPE: