made sequence handle calculation into a function, (lines were being copied around)
This commit is contained in:
@@ -51,6 +51,7 @@ void free_sequence(struct Sequence *seq);
|
|||||||
void build_seqar(struct ListBase *seqbase, struct Sequence ***seqar, int *totseq);
|
void build_seqar(struct ListBase *seqbase, struct Sequence ***seqar, int *totseq);
|
||||||
void free_editing(struct Editing *ed);
|
void free_editing(struct Editing *ed);
|
||||||
void calc_sequence(struct Sequence *seq);
|
void calc_sequence(struct Sequence *seq);
|
||||||
|
void calc_sequence_disp(struct Sequence *seq);
|
||||||
void sort_seq(void);
|
void sort_seq(void);
|
||||||
void clear_scene_in_allseqs(struct Scene *sce);
|
void clear_scene_in_allseqs(struct Scene *sce);
|
||||||
|
|
||||||
|
|||||||
@@ -587,23 +587,7 @@ static PyObject *getIntAttr( BPy_Sequence *self, void *type )
|
|||||||
/* internal functions for recursivly updating metastrip locatons */
|
/* internal functions for recursivly updating metastrip locatons */
|
||||||
static void intern_pos_update(Sequence * seq) {
|
static void intern_pos_update(Sequence * seq) {
|
||||||
/* update startdisp and enddisp */
|
/* update startdisp and enddisp */
|
||||||
if(seq->startofs && seq->startstill) seq->startstill= 0;
|
calc_sequence_disp(seq);
|
||||||
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; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void intern_recursive_pos_update(Sequence * seq, int offset) {
|
void intern_recursive_pos_update(Sequence * seq, int offset) {
|
||||||
|
|||||||
@@ -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)
|
void calc_sequence(Sequence *seq)
|
||||||
{
|
{
|
||||||
Sequence *seqm;
|
Sequence *seqm;
|
||||||
@@ -244,19 +261,7 @@ void calc_sequence(Sequence *seq)
|
|||||||
seq->enddisp= MIN3(seq->seq1->enddisp, seq->seq2->enddisp, seq->seq3->enddisp);
|
seq->enddisp= MIN3(seq->seq1->enddisp, seq->seq2->enddisp, seq->seq3->enddisp);
|
||||||
seq->len= seq->enddisp - seq->startdisp;
|
seq->len= seq->enddisp - seq->startdisp;
|
||||||
} else {
|
} else {
|
||||||
if(seq->startofs && seq->startstill) seq->startstill= 0;
|
calc_sequence_disp(seq);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(seq->strip && seq->len!=seq->strip->len) {
|
if(seq->strip && seq->len!=seq->strip->len) {
|
||||||
@@ -283,21 +288,7 @@ void calc_sequence(Sequence *seq)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
calc_sequence_disp(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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user