diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-10-18 03:24:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-10-18 03:24:09 +0400 |
commit | 1ca2823b54559e63d358dd521ce1c1b92eaedeb9 (patch) | |
tree | 3e9406f5a64dda66657deadb11bb58b11c952776 | |
parent | abb8771ed3402edd194799db4c2815824c92d647 (diff) |
made sequence handle calculation into a function, (lines were being copied around)
-rw-r--r-- | source/blender/include/BSE_sequence.h | 1 | ||||
-rw-r--r-- | source/blender/python/api2_2x/sceneSequence.c | 18 | ||||
-rw-r--r-- | source/blender/src/sequence.c | 47 |
3 files changed, 21 insertions, 45 deletions
diff --git a/source/blender/include/BSE_sequence.h b/source/blender/include/BSE_sequence.h index 47a09e154df..ff79d417537 100644 --- a/source/blender/include/BSE_sequence.h +++ b/source/blender/include/BSE_sequence.h @@ -51,6 +51,7 @@ void free_sequence(struct Sequence *seq); void build_seqar(struct ListBase *seqbase, struct Sequence ***seqar, int *totseq); void free_editing(struct Editing *ed); void calc_sequence(struct Sequence *seq); +void calc_sequence_disp(struct Sequence *seq); void sort_seq(void); void clear_scene_in_allseqs(struct Scene *sce); diff --git a/source/blender/python/api2_2x/sceneSequence.c b/source/blender/python/api2_2x/sceneSequence.c index 1cc4c8a2e15..9d3d4eb5508 100644 --- a/source/blender/python/api2_2x/sceneSequence.c +++ b/source/blender/python/api2_2x/sceneSequence.c @@ -587,23 +587,7 @@ static PyObject *getIntAttr( BPy_Sequence *self, void *type ) /* internal functions for recursivly updating metastrip locatons */ static void intern_pos_update(Sequence * seq) { /* update startdisp and enddisp */ - if(seq->startofs && seq->startstill) seq->startstill= 0; - if(seq->endofs && seq->endstill) seq->endstill= 0; - - seq->startdisp= seq->start + seq->startofs - seq->startstill; - seq->enddisp= seq->start+seq->len - seq->endofs + seq->endstill; - - seq->handsize= 10.0; /* 10 frames */ - if( seq->enddisp-seq->startdisp < 20 ) { - seq->handsize= (float)(0.5*(seq->enddisp-seq->startdisp)); - } - else if(seq->enddisp-seq->startdisp > 250) { - seq->handsize= (float)((seq->enddisp-seq->startdisp)/25); - } - - /* original Cambo code; replaced with c&p from function in blenkernel/sequence.c - seq->startdisp = seq->start + seq->startofs - seq->startstill; - seq->enddisp = ((seq->start + seq->len) - seq->endofs )+ seq->endstill; */ + calc_sequence_disp(seq); } void intern_recursive_pos_update(Sequence * seq, int offset) { diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index f9ad78dc732..e93cc1b1075 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -213,6 +213,23 @@ void free_editing(Editing *ed) } +void calc_sequence_disp(Sequence *seq) +{ + if(seq->startofs && seq->startstill) seq->startstill= 0; + if(seq->endofs && seq->endstill) seq->endstill= 0; + + seq->startdisp= seq->start + seq->startofs - seq->startstill; + seq->enddisp= seq->start+seq->len - seq->endofs + seq->endstill; + + seq->handsize= 10.0; /* 10 frames */ + if( seq->enddisp-seq->startdisp < 10 ) { + seq->handsize= (float)(0.5*(seq->enddisp-seq->startdisp)); + } + else if(seq->enddisp-seq->startdisp > 250) { + seq->handsize= (float)((seq->enddisp-seq->startdisp)/25); + } +} + void calc_sequence(Sequence *seq) { Sequence *seqm; @@ -244,19 +261,7 @@ void calc_sequence(Sequence *seq) seq->enddisp= MIN3(seq->seq1->enddisp, seq->seq2->enddisp, seq->seq3->enddisp); seq->len= seq->enddisp - seq->startdisp; } else { - if(seq->startofs && seq->startstill) seq->startstill= 0; - if(seq->endofs && seq->endstill) seq->endstill= 0; - - seq->startdisp= seq->start + seq->startofs - seq->startstill; - seq->enddisp= seq->start+seq->len - seq->endofs + seq->endstill; - - seq->handsize= 10.0; /* 10 frames */ - if( seq->enddisp-seq->startdisp < 20 ) { - seq->handsize= (float)(0.5*(seq->enddisp-seq->startdisp)); - } - else if(seq->enddisp-seq->startdisp > 250) { - seq->handsize= (float)((seq->enddisp-seq->startdisp)/25); - } + calc_sequence_disp(seq); } if(seq->strip && seq->len!=seq->strip->len) { @@ -283,21 +288,7 @@ void calc_sequence(Sequence *seq) } } } - - - if(seq->startofs && seq->startstill) seq->startstill= 0; - if(seq->endofs && seq->endstill) seq->endstill= 0; - - seq->startdisp= seq->start + seq->startofs - seq->startstill; - seq->enddisp= seq->start+seq->len - seq->endofs + seq->endstill; - - seq->handsize= 10.0; /* 10 frames */ - if( seq->enddisp-seq->startdisp < 20 ) { - seq->handsize= (float)(0.5*(seq->enddisp-seq->startdisp)); - } - else if(seq->enddisp-seq->startdisp > 250) { - seq->handsize= (float)((seq->enddisp-seq->startdisp)/25); - } + calc_sequence_disp(seq); } } |