== Sequencer ==
Fixed two issues with the sequencer: * using blend modes with startstill / endstill in combination with IPOs failed, since there was no room to store the composited result. (It was stored into the same TStripElem thereby effectively disabling the effect of the IPO) If you have no idea, what this is all about: A common case was: use a single PNG as a title, extrude and try to fade in / out using IPOs. * startstill / endstill are always displayed, so that one can change them also on movie-strips and scene-strips.
This commit is contained in:
@@ -129,6 +129,8 @@ void free_strip(Strip *strip)
|
||||
}
|
||||
|
||||
free_tstripdata(strip->len, strip->tstripdata);
|
||||
free_tstripdata(strip->endstill, strip->tstripdata_endstill);
|
||||
free_tstripdata(strip->startstill, strip->tstripdata_startstill);
|
||||
|
||||
MEM_freeN(strip);
|
||||
}
|
||||
@@ -136,11 +138,16 @@ void free_strip(Strip *strip)
|
||||
void new_tstripdata(Sequence *seq)
|
||||
{
|
||||
if(seq->strip) {
|
||||
if (seq->strip->tstripdata) {
|
||||
free_tstripdata(seq->strip->len,
|
||||
seq->strip->tstripdata);
|
||||
}
|
||||
free_tstripdata(seq->strip->len, seq->strip->tstripdata);
|
||||
free_tstripdata(seq->strip->endstill,
|
||||
seq->strip->tstripdata_endstill);
|
||||
free_tstripdata(seq->strip->startstill,
|
||||
seq->strip->tstripdata_startstill);
|
||||
|
||||
seq->strip->tstripdata= 0;
|
||||
seq->strip->tstripdata_endstill= 0;
|
||||
seq->strip->tstripdata_startstill= 0;
|
||||
|
||||
seq->strip->len= seq->len;
|
||||
}
|
||||
}
|
||||
@@ -765,6 +772,16 @@ static int give_stripelem_index(Sequence *seq, int cfra)
|
||||
return nr;
|
||||
}
|
||||
|
||||
static TStripElem* alloc_tstripdata(int len, const char * name)
|
||||
{
|
||||
int i;
|
||||
TStripElem *se = MEM_callocN(len * sizeof(TStripElem), name);
|
||||
for (i = 0; i < len; i++) {
|
||||
se[i].ok = STRIPELEM_OK;
|
||||
}
|
||||
return se;
|
||||
}
|
||||
|
||||
TStripElem *give_tstripelem(Sequence *seq, int cfra)
|
||||
{
|
||||
TStripElem *se;
|
||||
@@ -772,19 +789,65 @@ TStripElem *give_tstripelem(Sequence *seq, int cfra)
|
||||
|
||||
se = seq->strip->tstripdata;
|
||||
if (se == 0 && seq->len > 0) {
|
||||
int i;
|
||||
se = seq->strip->tstripdata = MEM_callocN(
|
||||
seq->len*sizeof(TStripElem), "tstripelems");
|
||||
for (i = 0; i < seq->len; i++) {
|
||||
se[i].ok = STRIPELEM_OK;
|
||||
}
|
||||
se = seq->strip->tstripdata = alloc_tstripdata(seq->len,
|
||||
"tstripelems");
|
||||
}
|
||||
nr = give_stripelem_index(seq, cfra);
|
||||
|
||||
if (nr == -1) return 0;
|
||||
if (se == 0) return 0;
|
||||
|
||||
se += nr;
|
||||
|
||||
/* if there are IPOs with blend modes active, one has to watch out
|
||||
for startstill + endstill area: we can't use the same tstripelem
|
||||
here for all ibufs, since then, blending with IPOs won't work!
|
||||
|
||||
Rather common case, if you use a single image and try to fade
|
||||
it in and out...
|
||||
|
||||
Performance TODO: seperate give_tstripelem for ibuf from
|
||||
give_tstripelem for ibuf_comp, so that caching works here again...
|
||||
*/
|
||||
if (seq->ipo && seq->ipo->curve.first && !(seq->type & SEQ_EFFECT)) {
|
||||
Strip * s = seq->strip;
|
||||
if (cfra < seq->start) {
|
||||
se = s->tstripdata_startstill;
|
||||
if (seq->startstill > s->startstill) {
|
||||
free_tstripdata(s->startstill,
|
||||
s->tstripdata_startstill);
|
||||
se = 0;
|
||||
}
|
||||
|
||||
if (se == 0) {
|
||||
s->startstill = seq->startstill;
|
||||
se = seq->strip->tstripdata_startstill
|
||||
= alloc_tstripdata(
|
||||
s->startstill,
|
||||
"tstripelems_startstill");
|
||||
}
|
||||
se += seq->start - cfra - 1;
|
||||
|
||||
} else if (cfra > seq->start + seq->len-1) {
|
||||
se = s->tstripdata_endstill;
|
||||
if (seq->endstill > s->endstill) {
|
||||
free_tstripdata(s->endstill,
|
||||
s->tstripdata_endstill);
|
||||
se = 0;
|
||||
}
|
||||
|
||||
if (se == 0) {
|
||||
s->endstill = seq->endstill;
|
||||
se = seq->strip->tstripdata_endstill
|
||||
= alloc_tstripdata(
|
||||
s->endstill,
|
||||
"tstripelems_endstill");
|
||||
}
|
||||
se += cfra - (seq->start + seq->len-1) - 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
se+= nr;
|
||||
se->nr= nr;
|
||||
|
||||
return se;
|
||||
@@ -2066,9 +2129,24 @@ void free_imbuf_seq_except(int cfra)
|
||||
if(seq->strip) {
|
||||
TStripElem * curelem = give_tstripelem(seq, cfra);
|
||||
|
||||
for(a=0, se= seq->strip->tstripdata; a<seq->len; a++, se++)
|
||||
if(se != curelem)
|
||||
for(a = 0, se = seq->strip->tstripdata;
|
||||
a < seq->strip->len && se; a++, se++) {
|
||||
if(se != curelem) {
|
||||
free_imbuf_strip_elem(se);
|
||||
}
|
||||
}
|
||||
for(a = 0, se = seq->strip->tstripdata_startstill;
|
||||
a < seq->strip->startstill && se; a++, se++) {
|
||||
if(se != curelem) {
|
||||
free_imbuf_strip_elem(se);
|
||||
}
|
||||
}
|
||||
for(a = 0, se = seq->strip->tstripdata_endstill;
|
||||
a < seq->strip->endstill && se; a++, se++) {
|
||||
if(se != curelem) {
|
||||
free_imbuf_strip_elem(se);
|
||||
}
|
||||
}
|
||||
|
||||
if(seq->type==SEQ_MOVIE)
|
||||
if(seq->startdisp > cfra || seq->enddisp < cfra)
|
||||
@@ -2089,9 +2167,17 @@ void free_imbuf_seq()
|
||||
|
||||
WHILE_SEQ(&ed->seqbase) {
|
||||
if(seq->strip) {
|
||||
if (seq->strip->tstripdata) {
|
||||
for(a=0, se= seq->strip->tstripdata; a<seq->len; a++, se++)
|
||||
free_imbuf_strip_elem(se);
|
||||
for(a = 0, se = seq->strip->tstripdata;
|
||||
a < seq->strip->len && se; a++, se++) {
|
||||
free_imbuf_strip_elem(se);
|
||||
}
|
||||
for(a = 0, se = seq->strip->tstripdata_startstill;
|
||||
a < seq->strip->startstill && se; a++, se++) {
|
||||
free_imbuf_strip_elem(se);
|
||||
}
|
||||
for(a = 0, se = seq->strip->tstripdata_endstill;
|
||||
a < seq->strip->endstill && se; a++, se++) {
|
||||
free_imbuf_strip_elem(se);
|
||||
}
|
||||
|
||||
if(seq->type==SEQ_MOVIE)
|
||||
|
||||
Reference in New Issue
Block a user