[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41934] trunk/blender/source/blender: Fix [#29190] VSE bugs.

Bastien Montagne montagne29 at wanadoo.fr
Wed Nov 16 21:03:55 CET 2011


Revision: 41934
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41934
Author:   mont29
Date:     2011-11-16 20:03:54 +0000 (Wed, 16 Nov 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/sequencer.c
    trunk/blender/source/blender/makesrna/intern/rna_sequencer.c

Modified: trunk/blender/source/blender/blenkernel/intern/sequencer.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/sequencer.c	2011-11-16 19:57:20 UTC (rev 41933)
+++ trunk/blender/source/blender/blenkernel/intern/sequencer.c	2011-11-16 20:03:54 UTC (rev 41934)
@@ -594,6 +594,9 @@
 		// 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.

Modified: trunk/blender/source/blender/makesrna/intern/rna_sequencer.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_sequencer.c	2011-11-16 19:57:20 UTC (rev 41933)
+++ trunk/blender/source/blender/makesrna/intern/rna_sequencer.c	2011-11-16 20:03:54 UTC (rev 41934)
@@ -191,6 +191,13 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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);




More information about the Bf-blender-cvs mailing list