== Sequencer ==
This fixes [#21087] Opacity of 0 turns off effect rather than affecting transparency and makes the whole early_out-business in strip stack a lot more readable. The actual fix is just using the composited result in layer fall through case (se1->ibuf_comp instead of se1->ibuf).
This commit is contained in:
@@ -2452,6 +2452,42 @@ static TStripElem* do_build_seq_recursively(Scene *scene, Sequence * seq, int cf
|
||||
return se;
|
||||
}
|
||||
|
||||
static int seq_must_swap_input_in_blend_mode(Sequence * seq)
|
||||
{
|
||||
int swap_input = FALSE;
|
||||
|
||||
/* bad hack, to fix crazy input ordering of
|
||||
those two effects */
|
||||
|
||||
if (seq->blend_mode == SEQ_ALPHAOVER ||
|
||||
seq->blend_mode == SEQ_ALPHAUNDER ||
|
||||
seq->blend_mode == SEQ_OVERDROP) {
|
||||
swap_input = TRUE;
|
||||
}
|
||||
|
||||
return swap_input;
|
||||
}
|
||||
|
||||
static int seq_get_early_out_for_blend_mode(Sequence * seq)
|
||||
{
|
||||
struct SeqEffectHandle sh = get_sequence_blend(seq);
|
||||
float facf = seq->blend_opacity / 100.0;
|
||||
int early_out = sh.early_out(seq, facf, facf);
|
||||
|
||||
if (early_out < 1) {
|
||||
return early_out;
|
||||
}
|
||||
|
||||
if (seq_must_swap_input_in_blend_mode(seq)) {
|
||||
if (early_out == 2) {
|
||||
return 1;
|
||||
} else if (early_out == 1) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return early_out;
|
||||
}
|
||||
|
||||
static TStripElem* do_build_seq_array_recursively(Scene *scene,
|
||||
ListBase *seqbasep, int cfra, int chanshown, int render_size)
|
||||
{
|
||||
@@ -2460,7 +2496,8 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
|
||||
int i;
|
||||
TStripElem* se = 0;
|
||||
|
||||
count = get_shown_sequences(seqbasep, cfra, chanshown, (Sequence **)&seq_arr);
|
||||
count = get_shown_sequences(seqbasep, cfra, chanshown,
|
||||
(Sequence **)&seq_arr);
|
||||
|
||||
if (!count) {
|
||||
return 0;
|
||||
@@ -2483,7 +2520,8 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
|
||||
|
||||
|
||||
if(count == 1) {
|
||||
se = do_build_seq_recursively(scene, seq_arr[0], cfra, render_size);
|
||||
se = do_build_seq_recursively(scene, seq_arr[0],
|
||||
cfra, render_size);
|
||||
if (se->ibuf) {
|
||||
se->ibuf_comp = se->ibuf;
|
||||
IMB_refImBuf(se->ibuf_comp);
|
||||
@@ -2495,8 +2533,6 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
|
||||
for (i = count - 1; i >= 0; i--) {
|
||||
int early_out;
|
||||
Sequence * seq = seq_arr[i];
|
||||
struct SeqEffectHandle sh;
|
||||
float facf;
|
||||
|
||||
se = give_tstripelem(seq, cfra);
|
||||
|
||||
@@ -2506,7 +2542,9 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
|
||||
break;
|
||||
}
|
||||
if (seq->blend_mode == SEQ_BLEND_REPLACE) {
|
||||
do_build_seq_recursively(scene, seq, cfra, render_size);
|
||||
do_build_seq_recursively(
|
||||
scene, seq, cfra, render_size);
|
||||
|
||||
if (se->ibuf) {
|
||||
se->ibuf_comp = se->ibuf;
|
||||
IMB_refImBuf(se->ibuf);
|
||||
@@ -2521,16 +2559,14 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
|
||||
break;
|
||||
}
|
||||
|
||||
sh = get_sequence_blend(seq);
|
||||
|
||||
facf = seq->blend_opacity / 100.0;
|
||||
|
||||
early_out = sh.early_out(seq, facf, facf);
|
||||
early_out = seq_get_early_out_for_blend_mode(seq);
|
||||
|
||||
switch (early_out) {
|
||||
case -1:
|
||||
case 2:
|
||||
do_build_seq_recursively(scene, seq, cfra, render_size);
|
||||
do_build_seq_recursively(
|
||||
scene, seq, cfra, render_size);
|
||||
|
||||
if (se->ibuf) {
|
||||
se->ibuf_comp = se->ibuf;
|
||||
IMB_refImBuf(se->ibuf_comp);
|
||||
@@ -2554,7 +2590,9 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
do_build_seq_recursively(scene, seq, cfra, render_size);
|
||||
do_build_seq_recursively(
|
||||
scene, seq, cfra, render_size);
|
||||
|
||||
if (!se->ibuf) {
|
||||
se->ibuf = IMB_allocImBuf(
|
||||
(short)seqrectx, (short)seqrecty,
|
||||
@@ -2584,14 +2622,13 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
|
||||
TStripElem* se2 = give_tstripelem(seq_arr[i], cfra);
|
||||
|
||||
float facf = seq->blend_opacity / 100.0;
|
||||
|
||||
int early_out = sh.early_out(seq, facf, facf);
|
||||
int swap_input = seq_must_swap_input_in_blend_mode(seq);
|
||||
int early_out = seq_get_early_out_for_blend_mode(seq);
|
||||
|
||||
switch (early_out) {
|
||||
case 0: {
|
||||
int x= se2->ibuf->x;
|
||||
int y= se2->ibuf->y;
|
||||
int swap_input = FALSE;
|
||||
|
||||
if(se1->ibuf_comp == NULL)
|
||||
continue;
|
||||
@@ -2626,15 +2663,6 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
|
||||
IMB_rect_from_float(se2->ibuf);
|
||||
}
|
||||
|
||||
/* bad hack, to fix crazy input ordering of
|
||||
those two effects */
|
||||
|
||||
if (seq->blend_mode == SEQ_ALPHAOVER ||
|
||||
seq->blend_mode == SEQ_ALPHAUNDER ||
|
||||
seq->blend_mode == SEQ_OVERDROP) {
|
||||
swap_input = TRUE;
|
||||
}
|
||||
|
||||
if (swap_input) {
|
||||
sh.execute(scene, seq, cfra,
|
||||
facf, facf, x, y,
|
||||
@@ -2657,7 +2685,7 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
se2->ibuf_comp = se1->ibuf;
|
||||
se2->ibuf_comp = se1->ibuf_comp;
|
||||
if(se2->ibuf_comp)
|
||||
IMB_refImBuf(se2->ibuf_comp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user