[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12276] trunk/blender/source/blender: made sequence handle calculation into a function, ( lines were being copied around)
Campbell Barton
cbarton at metavr.com
Thu Oct 18 01:24:09 CEST 2007
Revision: 12276
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12276
Author: campbellbarton
Date: 2007-10-18 01:24:09 +0200 (Thu, 18 Oct 2007)
Log Message:
-----------
made sequence handle calculation into a function, (lines were being copied around)
Modified Paths:
--------------
trunk/blender/source/blender/include/BSE_sequence.h
trunk/blender/source/blender/python/api2_2x/sceneSequence.c
trunk/blender/source/blender/src/sequence.c
Modified: trunk/blender/source/blender/include/BSE_sequence.h
===================================================================
--- trunk/blender/source/blender/include/BSE_sequence.h 2007-10-17 22:31:59 UTC (rev 12275)
+++ trunk/blender/source/blender/include/BSE_sequence.h 2007-10-17 23:24:09 UTC (rev 12276)
@@ -51,6 +51,7 @@
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);
Modified: trunk/blender/source/blender/python/api2_2x/sceneSequence.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/sceneSequence.c 2007-10-17 22:31:59 UTC (rev 12275)
+++ trunk/blender/source/blender/python/api2_2x/sceneSequence.c 2007-10-17 23:24:09 UTC (rev 12276)
@@ -587,23 +587,7 @@
/* 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) {
Modified: trunk/blender/source/blender/src/sequence.c
===================================================================
--- trunk/blender/source/blender/src/sequence.c 2007-10-17 22:31:59 UTC (rev 12275)
+++ trunk/blender/source/blender/src/sequence.c 2007-10-17 23:24:09 UTC (rev 12276)
@@ -213,6 +213,23 @@
}
+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 @@
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 @@
}
}
}
-
-
- 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);
}
}
More information about the Bf-blender-cvs
mailing list