diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-10-19 14:07:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-10-19 14:07:19 +0400 |
commit | 2c985dee976eb5b3ee6729312f046a344cb9947c (patch) | |
tree | bf77f8e12cc05e8569910a32a3fe4f1ab897926c /source | |
parent | 8802bea7a07ab0e29f5b4bcbf7b6074eced21a1b (diff) |
- listener for sequencer space panels added for frame changes, now redraws during transform
- invalid pointer was used for getting the sequencer length crashing blender or setting the length to negative values.
- printf_strip(seq) for debugging sequence strip locations
- Spelling: Cheet Sheet -> Cheat Sheet
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_sequence.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequence.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/space_sequencer.c | 8 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 52 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequence.c | 2 |
5 files changed, 52 insertions, 22 deletions
diff --git a/source/blender/blenkernel/BKE_sequence.h b/source/blender/blenkernel/BKE_sequence.h index f72617c8312..55c9d978f26 100644 --- a/source/blender/blenkernel/BKE_sequence.h +++ b/source/blender/blenkernel/BKE_sequence.h @@ -135,6 +135,7 @@ struct SeqEffectHandle { /* ********************* prototypes *************** */ /* sequence.c */ +void printf_strip(struct Sequence *seq); // extern void seq_free_sequence(struct Scene *scene, struct Sequence *seq); diff --git a/source/blender/blenkernel/intern/sequence.c b/source/blender/blenkernel/intern/sequence.c index b80df60e726..20433e4a3b1 100644 --- a/source/blender/blenkernel/intern/sequence.c +++ b/source/blender/blenkernel/intern/sequence.c @@ -69,6 +69,13 @@ static int blender_test_break() {return 0;} /* **** XXX ******** */ +void printf_strip(Sequence *seq) +{ + fprintf(stderr, "name: '%s', len:%d, start:%d, (startofs:%d, endofs:%d), (startstill:%d, endstill:%d), machine:%d, (startdisp:%d, enddisp:%d)\n", + seq->name, seq->len, seq->start, seq->startofs, seq->endofs, seq->startstill, seq->endstill, seq->machine, seq->startdisp, seq->enddisp); + fprintf(stderr, "\tseq_tx_set_final_left: %d %d\n\n", seq_tx_get_final_left(seq, 0), seq_tx_get_final_right(seq, 0)); +} + /* ********************************************************************** alloc / free functions ********************************************************************** */ @@ -3238,7 +3245,7 @@ void seq_tx_set_final_left(Sequence *seq, int val) { if (val < (seq)->start) { seq->startstill = abs(val - (seq)->start); - (seq)->startofs = 0; + seq->startofs = 0; } else { seq->startofs = abs(val - (seq)->start); seq->startstill = 0; @@ -3249,7 +3256,7 @@ void seq_tx_set_final_right(Sequence *seq, int val) { if (val > (seq)->start + (seq)->len) { seq->endstill = abs(val - (seq->start + (seq)->len)); - (seq)->endofs = 0; + seq->endofs = 0; } else { seq->endofs = abs(val - ((seq)->start + (seq)->len)); seq->endstill = 0; diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 626a3e6e2e0..206070b7095 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -245,6 +245,14 @@ static void sequencer_buttons_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ switch(wmn->category) { + case NC_SCENE: + switch(wmn->data) { + case ND_FRAME: + case ND_SEQUENCER: + ED_region_tag_redraw(ar); + break; + } + break; case NC_SPACE: if(wmn->data == ND_SPACE_SEQUENCER) ED_region_tag_redraw(ar); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 7d5ca4d57a1..51316a6c050 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4015,38 +4015,52 @@ static int SeqToTransData_Recursive(TransInfo *t, ListBase *seqbase, TransData * static void freeSeqData(TransInfo *t) { Editing *ed= seq_give_editing(t->scene, FALSE); - if (ed && !(t->state == TRANS_CANCEL)) { - ListBase *seqbasep= ed->seqbasep; - Sequence *seq; - int a; + if(ed != NULL) { + ListBase *seqbasep= ed->seqbasep; TransData *td= t->data; + int a; /* prevent updating the same seq twice * if the transdata order is changed this will mess up * but so will TransDataSeq */ Sequence *seq_prev= NULL; + Sequence *seq; + - /* flush to 2d vector from internally used 3d vector */ - for(a=0; a<t->total; a++, td++) { - seq= ((TransDataSeq *)td->extra)->seq; - if ((seq != seq_prev) && (seq->depth==0) && (seq->flag & SEQ_OVERLAP)) { - shuffle_seq(seqbasep, seq); + if (!(t->state == TRANS_CANCEL)) { + + /* flush to 2d vector from internally used 3d vector */ + for(a=0; a<t->total; a++, td++) { + seq= ((TransDataSeq *)td->extra)->seq; + if ((seq != seq_prev) && (seq->depth==0) && (seq->flag & SEQ_OVERLAP)) { + shuffle_seq(seqbasep, seq); + } + + seq_prev= seq; } - seq_prev= seq; - } + for(seq= seqbasep->first; seq; seq= seq->next) { + /* We might want to build a list of effects that need to be updated during transform */ + if(seq->type & SEQ_EFFECT) { + if (seq->seq1 && seq->seq1->flag & SELECT) calc_sequence(seq); + else if (seq->seq2 && seq->seq2->flag & SELECT) calc_sequence(seq); + else if (seq->seq3 && seq->seq3->flag & SELECT) calc_sequence(seq); + } + } - for(seq= seqbasep->first; seq; seq= seq->next) { - /* We might want to build a list of effects that need to be updated during transform */ - if(seq->type & SEQ_EFFECT) { - if (seq->seq1 && seq->seq1->flag & SELECT) calc_sequence(seq); - else if (seq->seq2 && seq->seq2->flag & SELECT) calc_sequence(seq); - else if (seq->seq3 && seq->seq3->flag & SELECT) calc_sequence(seq); + sort_seq(t->scene); + } + else { + /* Cancelled, need to update the strips display */ + for(a=0; a<t->total; a++, td++) { + seq= ((TransDataSeq *)td->extra)->seq; + if ((seq != seq_prev) && (seq->depth==0)) { + calc_sequence_disp(seq); + } + seq_prev= seq; } } - - sort_seq(t->scene); } if (t->customData) { diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index c48031d51b3..8bbffa4425a 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -85,7 +85,7 @@ static void rna_SequenceEditor_length_set(PointerRNA *ptr, int value) static int rna_SequenceEditor_length_get(PointerRNA *ptr) { Sequence *seq= (Sequence*)ptr->data; - return seq_tx_get_final_right(seq, 1)-seq_tx_get_final_left(seq, 1); + return seq_tx_get_final_right(seq, 0)-seq_tx_get_final_left(seq, 0); } static void rna_SequenceEditor_channel_set(PointerRNA *ptr, int value) |