Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2011-11-17 00:03:54 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2011-11-17 00:03:54 +0400
commit819d1f417d2fb61719771d20b4999831dd24ca03 (patch)
tree175b73efafebfcbc895027e3b3f6695d6e004b63 /source
parent3dcc9aef9685388255d4cf9d646830d573aeb932 (diff)
Fix [#29190] VSE bugs.
Only real bug was, that effect strips' start frame and length were editable. Made all four frame properties readonly on RNA level for those kind of strips (those for which get_sequence_effect_num_inputs returns a non-null value). Also fixed the tooltip of frame_final_duration.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/sequencer.c3
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c13
2 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 53878176fec..5d35867d9c3 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -594,6 +594,9 @@ void calc_sequence(Scene *scene, Sequence *seq)
// seq->enddisp= MIN2(seq->seq1->enddisp, seq->seq2->enddisp);
if (seq->seq1) {
+ /* XXX These resets should not be necessary, but users used to be able to
+ * edit effect's length, leading to strange results. See #29190. */
+ seq->startofs = seq->endofs = seq->startstill = seq->endstill = 0;
seq->start= seq->startdisp= MAX3(seq->seq1->startdisp, seq->seq2->startdisp, seq->seq3->startdisp);
seq->enddisp= MIN3(seq->seq1->enddisp, seq->seq2->enddisp, seq->seq3->enddisp);
/* we cant help if strips don't overlap, it wont give useful results.
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index f3b158f84fe..4db23443895 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -191,6 +191,13 @@ static int rna_Sequence_frame_length_get(PointerRNA *ptr)
return seq_tx_get_final_right(seq, 0)-seq_tx_get_final_left(seq, 0);
}
+static int rna_Sequence_frame_editable(PointerRNA *ptr)
+{
+ Sequence *seq = (Sequence*)ptr->data;
+ /* Effect sequences' start frame and length must be readonly! */
+ return (get_sequence_effect_num_inputs(seq->type))? 0: PROP_EDITABLE;
+}
+
static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
{
Sequence *seq= (Sequence*)ptr->data;
@@ -1025,8 +1032,9 @@ static void rna_def_sequence(BlenderRNA *brna)
prop= RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME);
RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied");
+ RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip after the handles are applied");
RNA_def_property_int_funcs(prop, "rna_Sequence_frame_length_get", "rna_Sequence_frame_length_set",NULL);
+ RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
prop= RNA_def_property(srna, "frame_duration", PROP_INT, PROP_TIME);
@@ -1040,6 +1048,7 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Start Frame", "");
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set",NULL); // overlap tests and calc_seq_disp
+ RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
prop= RNA_def_property(srna, "frame_final_start", PROP_INT, PROP_TIME);
@@ -1047,6 +1056,7 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Start Frame", "Start frame displayed in the sequence editor after offsets are applied, setting this is equivalent to moving the handle, not the actual start frame");
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL); // overlap tests and calc_seq_disp
+ RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
prop= RNA_def_property(srna, "frame_final_end", PROP_INT, PROP_TIME);
@@ -1054,6 +1064,7 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "End Frame", "End frame displayed in the sequence editor after offsets are applied");
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_end_frame_final_set", NULL); // overlap tests and calc_seq_disp
+ RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
prop= RNA_def_property(srna, "frame_offset_start", PROP_INT, PROP_TIME);