[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20793] branches/blender2.5/blender: patch from Xavier Thomas, make the sequence strip start frame and channel editable
Campbell Barton
ideasman42 at gmail.com
Wed Jun 10 21:57:06 CEST 2009
Revision: 20793
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20793
Author: campbellbarton
Date: 2009-06-10 21:57:06 +0200 (Wed, 10 Jun 2009)
Log Message:
-----------
patch from Xavier Thomas, make the sequence strip start frame and channel editable
Modified Paths:
--------------
branches/blender2.5/blender/release/ui/space_sequencer.py
branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c
Modified: branches/blender2.5/blender/release/ui/space_sequencer.py
===================================================================
--- branches/blender2.5/blender/release/ui/space_sequencer.py 2009-06-10 19:35:16 UTC (rev 20792)
+++ branches/blender2.5/blender/release/ui/space_sequencer.py 2009-06-10 19:57:06 UTC (rev 20793)
@@ -285,7 +285,16 @@
col.itemR(strip, "start_frame")
col.itemR(strip, "length")
+ split = layout.split()
+ col = split.column()
+ col.itemR(strip, "start_offset")
+ col.itemR(strip, "start_still")
+
+ col = split.column()
+ col.itemR(strip, "end_offset")
+ col.itemR(strip, "end_still")
+
class SEQUENCER_PT_effect(SequencerButtonsPanel):
__label__ = "Effect Strip"
__idname__ = "SEQUENCER_PT_effect"
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c 2009-06-10 19:35:16 UTC (rev 20792)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c 2009-06-10 19:57:06 UTC (rev 20793)
@@ -48,6 +48,56 @@
strcpy(str, "Sequence Editor");
}
+static void rna_SequenceEditor_start_frame_set(PointerRNA *ptr, int value)
+{
+ Sequence *seq= (Sequence*)ptr->data;
+ Scene *sce= (Scene*)ptr->id.data;
+ Editing *ed= seq_give_editing(sce, FALSE);
+
+ seq->start= value;
+ calc_sequence_disp(seq);
+
+ if( seq_test_overlap(ed->seqbasep, seq) ) {
+ shuffle_seq(ed->seqbasep, seq);
+ }
+ sort_seq(sce);
+}
+
+static void rna_SequenceEditor_length_set(PointerRNA *ptr, int value)
+{
+ Sequence *seq= (Sequence*)ptr->data;
+ Scene *sce= (Scene*)ptr->id.data;
+ Editing *ed= seq_give_editing(sce, FALSE);
+
+ seq_tx_set_final_right(seq, seq->start+value);
+ calc_sequence_disp(seq);
+
+ if( seq_test_overlap(ed->seqbasep, seq) ) {
+ shuffle_seq(ed->seqbasep, seq);
+ }
+ sort_seq(sce);
+}
+
+static int rna_SequenceEditor_length_get(PointerRNA *ptr)
+{
+ Sequence *seq= (Sequence*)ptr->data;
+ return seq_tx_get_final_right(seq, 1)-seq_tx_get_final_left(seq, 1);
+}
+
+static void rna_SequenceEditor_channel_set(PointerRNA *ptr, int value)
+{
+ Sequence *seq= (Sequence*)ptr->data;
+ Scene *sce= (Scene*)ptr->id.data;
+ Editing *ed= seq_give_editing(sce, FALSE);
+
+ seq->machine= value;
+
+ if( seq_test_overlap(ed->seqbasep, seq) ) {
+ shuffle_seq(ed->seqbasep, seq);
+ }
+ sort_seq(sce);
+}
+
/* name functions that ignore the first two characters */
static void rna_Sequence_name_get(PointerRNA *ptr, char *value)
{
@@ -329,13 +379,14 @@
prop= RNA_def_property(srna, "length", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "len");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); // computed from other values
+ RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied");
-
+ RNA_def_property_int_funcs(prop, "rna_SequenceEditor_length_get", "rna_SequenceEditor_length_set",NULL);
+
prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "start");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
RNA_def_property_ui_text(prop, "Start Frame", "");
+ RNA_def_property_int_funcs(prop, NULL, "rna_SequenceEditor_start_frame_set",NULL); // overlap tests and calc_seq_disp
prop= RNA_def_property(srna, "start_offset", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "startofs");
@@ -361,8 +412,8 @@
prop= RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "machine");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test
RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip.");
+ RNA_def_property_int_funcs(prop, NULL, "rna_SequenceEditor_channel_set",NULL); // overlap test
/* blending */
More information about the Bf-blender-cvs
mailing list