diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-07-04 12:49:54 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-07-04 12:49:54 +0400 |
commit | 5553f66eb777ff4ee589b91b42258e5e7a6fbfec (patch) | |
tree | 582f2101f4a88ed0bdf9442075ff76d9688aa5db /source | |
parent | c7869f9f85989e35c2c030a78c04a4569e4946ff (diff) |
sequencer
- 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).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_add.c | 17 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 28 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_sequence_types.h | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 4 |
5 files changed, 36 insertions, 20 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index baeff5a838b..d0678bc1866 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -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); diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index cfcc3b6e81d..36ae475e64b 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -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); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index e50d9b54fa4..e449490516c 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -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); } diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 03a3b75aa1e..4530e91910b 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -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 diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 4ee4fde0d8a..c7c7888a938 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -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: |