== Sequencer ==

Brought back default effect fading: (adding a wipe effect makes it
wipe by default for the length of the strip)

First round in upgrading IPOs from older versions. (works for non-IPO
case now and sets at least the new "default effect fade"-flag)

Still non-working for old IPOs, since Sequence-Strips aren't real IDs!

And: non-frame-lock case should stretch the FCurve to the right length!
This commit is contained in:
Peter Schlaile
2009-11-29 18:14:16 +00:00
parent ae16f46573
commit a22cfe99db
7 changed files with 96 additions and 17 deletions

View File

@@ -351,7 +351,10 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel):
if not strip:
return False
return strip.type in ('COLOR', 'WIPE', 'GLOW', 'SPEED', 'TRANSFORM')
return strip.type in ('ADD','SUBTRACT','ALPHA_OVER','ALPHA_UNDER',
'GAMMA_CROSS','MULTIPLY','OVER_DROP',
'PLUGIN',
'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED')
def draw(self, context):
layout = self.layout
@@ -431,7 +434,9 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel):
if strip.type == 'SPEED':
col.prop(strip, "speed_fader", text="Speed fader")
else:
col.prop(strip, "effect_fader", text="Effect fader")
col.prop(strip, "use_effect_default_fade", "Default fade")
if not strip.use_effect_default_fade:
col.prop(strip, "effect_fader", text="Effect fader")
class SEQUENCER_PT_input(SequencerButtonsPanel):

View File

@@ -885,6 +885,17 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co
case ID_SEQ: /* sequencer strip */
//SEQ_FAC1:
switch (adrcode) {
case SEQ_FAC1:
propname= "effect_fader";
break;
case SEQ_FAC_SPEED:
propname= "speed_fader";
break;
case SEQ_FAC_OPACITY:
propname= "blend_opacity";
break;
}
// poin= &(seq->facf0); // XXX this doesn't seem to be included anywhere in sequencer RNA...
break;
@@ -1604,6 +1615,7 @@ void do_versions_ipos_to_animato(Main *main)
ListBase drivers = {NULL, NULL};
ID *id;
AnimData *adt;
Scene *scene;
if (main == NULL) {
printf("Argh! Main is NULL in do_versions_ipos_to_animato() \n");
@@ -1781,6 +1793,51 @@ void do_versions_ipos_to_animato(Main *main)
}
}
/* sequence strips */
for(scene = main->scene.first; scene; scene = scene->id.next) {
if(scene->ed && scene->ed->seqbasep) {
Sequence * seq;
for(seq = scene->ed->seqbasep->first;
seq; seq = seq->next) {
short adrcode = SEQ_FAC1;
if (G.f & G_DEBUG)
printf("\tconverting sequence strip %s \n", seq->name+2);
if (!seq->ipo || !seq->ipo->curve.first) {
seq->flag |=
SEQ_USE_EFFECT_DEFAULT_FADE;
continue;
}
/* patch adrcode, so that we can map
to different DNA variables later
(semi-hack (tm) )
*/
switch(seq->type) {
case SEQ_IMAGE:
case SEQ_META:
case SEQ_SCENE:
case SEQ_MOVIE:
case SEQ_COLOR:
adrcode = SEQ_FAC_OPACITY;
break;
case SEQ_SPEED:
adrcode = SEQ_FAC_SPEED;
break;
}
((IpoCurve*) seq->ipo->curve.first)
->adrcode = adrcode;
ipo_to_animdata((ID*) seq, seq->ipo,
NULL, NULL);
seq->ipo->id.us--;
seq->ipo = NULL;
}
}
}
/* textures */
for (id= main->tex.first; id; id= id->next) {
Tex *te= (Tex *)id;

View File

@@ -820,16 +820,19 @@ static void do_effect(Scene *scene, int cfra, Sequence *seq, TStripElem * se)
return;
}
fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence,
"effect_fader", 0);
if (!fcu) {
if ((seq->flag & SEQ_USE_EFFECT_DEFAULT_FADE) != 0) {
sh.get_default_fac(seq, cfra, &fac, &facf);
if( scene->r.mode & R_FIELDS ); else facf= fac;
} else {
fac = facf = evaluate_fcurve(fcu, cfra);
if( scene->r.mode & R_FIELDS ) {
facf = evaluate_fcurve(fcu, cfra + 0.5);
fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence,
"effect_fader", 0);
if (fcu) {
fac = facf = evaluate_fcurve(fcu, cfra);
if( scene->r.mode & R_FIELDS ) {
facf = evaluate_fcurve(fcu, cfra + 0.5);
}
} else {
fac = facf = seq->effect_fader;
}
}
@@ -2122,16 +2125,19 @@ static void do_effect_seq_recursively(Scene *scene, Sequence *seq, TStripElem *s
se->se2 = 0;
se->se3 = 0;
fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence,
"effect_fader", 0);
if (!fcu) {
if ((seq->flag & SEQ_USE_EFFECT_DEFAULT_FADE) != 0) {
sh.get_default_fac(seq, cfra, &fac, &facf);
if( scene->r.mode & R_FIELDS ); else facf= fac;
} else {
fac = facf = evaluate_fcurve(fcu, cfra);
if( scene->r.mode & R_FIELDS ) {
facf = evaluate_fcurve(fcu, cfra + 0.5);
fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence,
"effect_fader", 0);
if (fcu) {
fac = facf = evaluate_fcurve(fcu, cfra);
if( scene->r.mode & R_FIELDS ) {
facf = evaluate_fcurve(fcu, cfra + 0.5);
}
} else {
fac = facf = seq->effect_fader;
}
}

View File

@@ -513,6 +513,8 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
seq_tx_set_final_right(seq, end_frame);
}
seq->flag |= SEQ_USE_EFFECT_DEFAULT_FADE;
calc_sequence(seq);
/* basic defaults */

View File

@@ -275,6 +275,8 @@ typedef struct Ipo {
#define SEQ_TOTNAM 1
#define SEQ_FAC1 1
#define SEQ_FAC_SPEED 2
#define SEQ_FAC_OPACITY 3
/* ********* Curve (ID_CU) *********** */

View File

@@ -268,6 +268,7 @@ typedef struct SpeedControlVars {
#define SEQ_USE_COLOR_BALANCE 262144
#define SEQ_USE_PROXY_CUSTOM_DIR 524288
#define SEQ_USE_PROXY_CUSTOM_FILE 2097152
#define SEQ_USE_EFFECT_DEFAULT_FADE 4194304
/* deprecated, dont use a flag anymore*/
/*#define SEQ_ACTIVE 1048576*/

View File

@@ -538,6 +538,12 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Effect fader position", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "use_effect_default_fade", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_EFFECT_DEFAULT_FADE);
RNA_def_property_ui_text(prop, "Use Default Fade", "Fade effect using the builtin default (usually make transition as long as effect strip).");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "speed_fader", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "speed_fader");
RNA_def_property_ui_text(prop, "Speed effect fader position", "");
@@ -637,7 +643,7 @@ static void rna_def_filter_video(StructRNA *srna)
RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing.");
RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_translation_set");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->transform");
RNA_def_property_ui_text(prop, "Transform", "");