Sequencer fix: Transform Strip wouldn't work with default_fader
* added default_fader to transform strip, since it used the old fac too. * removed ANIMATEABLE attribute from the settings in the transform strip, since they are animated via the effect_fader and not directly for now. (too confusing) * UI: only show default_fader for the effect strips that support it Sequencer Durian feature: uniform scale for Sequence transform strip. * for now re-using variable for x-axis scaling. Note: This brings back functionality as close to 2.49 as possible. The Start and End values in the current design are not meant to be animated directly, but via the effect_fader.
This commit is contained in:
@@ -401,14 +401,23 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel):
|
||||
layout.separator()
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Scale X:")
|
||||
col.prop(strip, "scale_start_x", text="Start")
|
||||
col.prop(strip, "scale_end_x", text="End")
|
||||
col.prop(strip, "uniform_scale")
|
||||
|
||||
if (strip.uniform_scale):
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Scale:")
|
||||
col.prop(strip, "scale_start_x", text="Start")
|
||||
col.prop(strip, "scale_end_x", text="End")
|
||||
else:
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Scale X:")
|
||||
col.prop(strip, "scale_start_x", text="Start")
|
||||
col.prop(strip, "scale_end_x", text="End")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Scale Y:")
|
||||
col.prop(strip, "scale_start_y", text="Start")
|
||||
col.prop(strip, "scale_end_y", text="End")
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Scale Y:")
|
||||
col.prop(strip, "scale_start_y", text="Start")
|
||||
col.prop(strip, "scale_end_y", text="End")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@@ -420,10 +429,11 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel):
|
||||
col = layout.column(align=True)
|
||||
if strip.type == 'SPEED':
|
||||
col.prop(strip, "speed_fader", text="Speed fader")
|
||||
else:
|
||||
col.prop(strip, "use_effect_default_fade", "Default fade")
|
||||
if not strip.use_effect_default_fade:
|
||||
col.prop(strip, "effect_fader", text="Effect fader")
|
||||
elif strip.type in ('CROSS', 'GAMMA_CROSS', 'PLUGIN', 'WIPE',
|
||||
'TRANSFORM'):
|
||||
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):
|
||||
|
||||
@@ -2007,8 +2007,12 @@ static void do_transform(Sequence * seq,float facf0, int x, int y,
|
||||
yo = y;
|
||||
|
||||
//factor scale
|
||||
factxScale = scale->ScalexIni + (scale->ScalexFin - scale->ScalexIni) * facf0;
|
||||
factyScale = scale->ScaleyIni + (scale->ScaleyFin - scale->ScaleyIni) * facf0;
|
||||
if (scale->uniform_scale) {
|
||||
factxScale = factyScale = scale->ScalexIni + (scale->ScalexFin - scale->ScalexIni) * facf0;
|
||||
} else {
|
||||
factxScale = scale->ScalexIni + (scale->ScalexFin - scale->ScalexIni) * facf0;
|
||||
factyScale = scale->ScaleyIni + (scale->ScaleyFin - scale->ScaleyIni) * facf0;
|
||||
}
|
||||
|
||||
//Factor translate
|
||||
if(!scale->percent){
|
||||
@@ -3080,6 +3084,7 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
|
||||
rval.free = free_transform_effect;
|
||||
rval.copy = copy_transform_effect;
|
||||
rval.execute = do_transform_effect;
|
||||
rval.get_default_fac = get_default_fac_fade;
|
||||
break;
|
||||
case SEQ_SPEED:
|
||||
rval.init = init_speed_effect;
|
||||
|
||||
@@ -221,6 +221,7 @@ typedef struct TransformVars {
|
||||
float rotFin;
|
||||
int percent;
|
||||
int interpolation;
|
||||
int uniform_scale; /* preserve aspect/ratio when scaling */
|
||||
} TransformVars;
|
||||
|
||||
typedef struct SolidColorVars {
|
||||
|
||||
@@ -1063,72 +1063,90 @@ static void rna_def_transform(BlenderRNA *brna)
|
||||
|
||||
prop= RNA_def_property(srna, "scale_start_x", PROP_FLOAT, PROP_UNSIGNED);
|
||||
RNA_def_property_float_sdna(prop, NULL, "ScalexIni");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* seq->facf0 is used to animate this */
|
||||
RNA_def_property_ui_text(prop, "Scale Start X", "");
|
||||
RNA_def_property_ui_range(prop, 0, 10, 3, 10);
|
||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||
|
||||
prop= RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED);
|
||||
RNA_def_property_float_sdna(prop, NULL, "ScaleyIni");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* seq->facf0 is used to animate this */
|
||||
RNA_def_property_ui_text(prop, "Scale Start Y", "");
|
||||
RNA_def_property_ui_range(prop, 0, 10, 3, 10);
|
||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||
|
||||
prop= RNA_def_property(srna, "scale_end_x", PROP_FLOAT, PROP_UNSIGNED);
|
||||
RNA_def_property_float_sdna(prop, NULL, "ScalexFin");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* seq->facf0 is used to animate this */
|
||||
RNA_def_property_ui_text(prop, "Scale End X", "");
|
||||
RNA_def_property_ui_range(prop, 0, 10, 3, 10);
|
||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||
|
||||
prop= RNA_def_property(srna, "scale_end_y", PROP_FLOAT, PROP_UNSIGNED);
|
||||
RNA_def_property_float_sdna(prop, NULL, "ScaleyFin");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* seq->facf0 is used to animate this */
|
||||
RNA_def_property_ui_text(prop, "Scale End Y", "");
|
||||
RNA_def_property_ui_range(prop, 0, 10, 3, 10);
|
||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||
|
||||
prop= RNA_def_property(srna, "uniform_scale", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "uniform_scale", 0);
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* not meant to be animated */
|
||||
RNA_def_property_ui_text(prop, "Uniform Scale", "Scale uniformly, preserving aspect ratio.");
|
||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||
|
||||
prop= RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "xIni");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* seq->facf0 is used to animate this */
|
||||
RNA_def_property_ui_text(prop, "Translate Start X", "");
|
||||
RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
|
||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||
|
||||
prop= RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "yIni");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* seq->facf0 is used to animate this */
|
||||
RNA_def_property_ui_text(prop, "Translate Start Y", "");
|
||||
RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
|
||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||
|
||||
prop= RNA_def_property(srna, "translate_end_x", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "xFin");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* seq->facf0 is used to animate this */
|
||||
RNA_def_property_ui_text(prop, "Translate End X", "");
|
||||
RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
|
||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||
|
||||
prop= RNA_def_property(srna, "translate_end_y", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "yFin");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* seq->facf0 is used to animate this */
|
||||
RNA_def_property_ui_text(prop, "Translate End Y", "");
|
||||
RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
|
||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||
|
||||
prop= RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "rotIni");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* seq->facf0 is used to animate this */
|
||||
RNA_def_property_range(prop, 0.0f, 360.0f);
|
||||
RNA_def_property_ui_text(prop, "Rotation Start", "");
|
||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||
|
||||
prop= RNA_def_property(srna, "rotation_end", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "rotFin");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* seq->facf0 is used to animate this */
|
||||
RNA_def_property_range(prop, 0.0f, 360.0f);
|
||||
RNA_def_property_ui_text(prop, "Rotation End", "");
|
||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||
|
||||
prop= RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "percent");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* not meant to be animated */
|
||||
RNA_def_property_enum_items(prop, translation_unit_items);
|
||||
RNA_def_property_ui_text(prop, "Translation Unit", "");
|
||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||
|
||||
prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, interpolation_items);
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* not meant to be animated */
|
||||
RNA_def_property_ui_text(prop, "Interpolation", "");
|
||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user