[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25210] trunk/blender/source/blender/ makesrna/intern/rna_sequence.c: RNA: added common sequencer properties notifiers/updates.

Brecht Van Lommel brecht at blender.org
Tue Dec 8 13:59:21 CET 2009


Revision: 25210
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25210
Author:   blendix
Date:     2009-12-08 13:59:21 +0100 (Tue, 08 Dec 2009)

Log Message:
-----------
RNA: added common sequencer properties notifiers/updates. Still some
updates missing.

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_sequence.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_sequence.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_sequence.c	2009-12-08 12:16:34 UTC (rev 25209)
+++ trunk/blender/source/blender/makesrna/intern/rna_sequence.c	2009-12-08 12:59:21 UTC (rev 25210)
@@ -42,7 +42,7 @@
 
 #ifdef RNA_RUNTIME
 
-static void rna_SequenceEditor_start_frame_set(PointerRNA *ptr, int value)
+static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value)
 {
 	Sequence *seq= (Sequence*)ptr->data;
 	Scene *sce= (Scene*)ptr->id.data;
@@ -57,7 +57,7 @@
 	sort_seq(sce);
 }
 
-static void rna_SequenceEditor_length_set(PointerRNA *ptr, int value)
+static void rna_Sequence_length_set(PointerRNA *ptr, int value)
 {
 	Sequence *seq= (Sequence*)ptr->data;
 	Scene *sce= (Scene*)ptr->id.data;
@@ -72,13 +72,13 @@
 	sort_seq(sce);
 }
 
-static int rna_SequenceEditor_length_get(PointerRNA *ptr)
+static int rna_Sequence_length_get(PointerRNA *ptr)
 {
 	Sequence *seq= (Sequence*)ptr->data;
 	return seq_tx_get_final_right(seq, 0)-seq_tx_get_final_left(seq, 0);
 }
 
-static void rna_SequenceEditor_channel_set(PointerRNA *ptr, int value)
+static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
 {
 	Sequence *seq= (Sequence*)ptr->data;
 	Scene *sce= (Scene*)ptr->id.data;
@@ -93,7 +93,7 @@
 }
 
 /* properties that need to allocate structs */
-static void rna_SequenceEditor_use_color_balance_set(PointerRNA *ptr, int value)
+static void rna_Sequence_use_color_balance_set(PointerRNA *ptr, int value)
 {
 	Sequence *seq= (Sequence*)ptr->data;
 	int c;
@@ -113,7 +113,7 @@
 	}
 }
 
-static void rna_SequenceEditor_use_proxy_set(PointerRNA *ptr, int value)
+static void rna_Sequence_use_proxy_set(PointerRNA *ptr, int value)
 {
 	Sequence *seq= (Sequence*)ptr->data;
 	if(value) {
@@ -126,7 +126,7 @@
 	}
 }
 
-static void rna_SequenceEditor_use_translation_set(PointerRNA *ptr, int value)
+static void rna_Sequence_use_translation_set(PointerRNA *ptr, int value)
 {
 	Sequence *seq= (Sequence*)ptr->data;
 	if(value) {
@@ -139,7 +139,7 @@
 	}
 }
 
-static void rna_SequenceEditor_use_crop_set(PointerRNA *ptr, int value)
+static void rna_Sequence_use_crop_set(PointerRNA *ptr, int value)
 {
 	Sequence *seq= (Sequence*)ptr->data;
 	if(value) {
@@ -263,6 +263,19 @@
 	BLI_strncpy(elem->name, name, sizeof(elem->name));
 }
 
+static void rna_Sequence_update(bContext *C, PointerRNA *ptr)
+{
+	Scene *scene= (Scene*)ptr->id.data;
+	Editing *ed= seq_give_editing(scene, FALSE);
+
+	free_imbuf_seq(scene, &ed->seqbase, FALSE);
+}
+
+static void rna_Sequence_sound_update(bContext *C, PointerRNA *ptr)
+{
+	/* TODO */
+}
+
 #else
 
 static void rna_def_strip_element(BlenderRNA *brna)
@@ -278,6 +291,7 @@
 	RNA_def_property_string_sdna(prop, NULL, "name");
 	RNA_def_property_ui_text(prop, "Filename", "");
 	RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SequenceElement_filename_set");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 }
 
 static void rna_def_strip_crop(BlenderRNA *brna)
@@ -292,18 +306,22 @@
 	prop= RNA_def_property(srna, "top", PROP_INT, PROP_UNSIGNED);
 	RNA_def_property_ui_text(prop, "Top", "");
 	RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 	
 	prop= RNA_def_property(srna, "bottom", PROP_INT, PROP_UNSIGNED);
 	RNA_def_property_ui_text(prop, "Bottom", "");
 	RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 	
 	prop= RNA_def_property(srna, "left", PROP_INT, PROP_UNSIGNED);
 	RNA_def_property_ui_text(prop, "Left", "");
 	RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 
 	prop= RNA_def_property(srna, "right", PROP_INT, PROP_UNSIGNED);
 	RNA_def_property_ui_text(prop, "Right", "");
 	RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 }
 
 static void rna_def_strip_transform(BlenderRNA *brna)
@@ -319,11 +337,13 @@
 	RNA_def_property_int_sdna(prop, NULL, "xofs");
 	RNA_def_property_ui_text(prop, "Offset Y", "");
 	RNA_def_property_ui_range(prop, -4096, 4096, 1, 0);
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 
 	prop= RNA_def_property(srna, "offset_y", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "yofs");
 	RNA_def_property_ui_text(prop, "Offset Y", "");
 	RNA_def_property_ui_range(prop, -4096, 4096, 1, 0);
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 }
 
 static void rna_def_strip_proxy(BlenderRNA *brna)
@@ -338,10 +358,12 @@
 	prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
 	RNA_def_property_string_sdna(prop, NULL, "dir");
 	RNA_def_property_ui_text(prop, "Directory", "Location to story the proxy file");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 	
 	prop= RNA_def_property(srna, "file", PROP_STRING, PROP_DIRPATH);
 	RNA_def_property_string_sdna(prop, NULL, "file");
 	RNA_def_property_ui_text(prop, "File", "Proxy file name");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 }
 
 static void rna_def_strip_color_balance(BlenderRNA *brna)
@@ -355,33 +377,41 @@
 
 	prop= RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR);
 	RNA_def_property_ui_text(prop, "Lift", "Color balance lift (shadows).");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 	
 	prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR);
 	RNA_def_property_ui_text(prop, "Gamma", "Color balance gamma (midtones).");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 	
 	prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR);
 	RNA_def_property_ui_text(prop, "Gain", "Color balance gain (highlights).");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 	
 	prop= RNA_def_property(srna, "inverse_gain", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAIN);
 	RNA_def_property_ui_text(prop, "Inverse Gain", "");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 
 	prop= RNA_def_property(srna, "inverse_gamma", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAMMA);
 	RNA_def_property_ui_text(prop, "Inverse Gamma", "");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 
 	prop= RNA_def_property(srna, "inverse_lift", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_LIFT);
 	RNA_def_property_ui_text(prop, "Inverse Lift", "");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 	
 	/* not yet used
 	prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "Exposure", "");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 	
 	prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_range(prop, 0.0f, 1.0f);
-	RNA_def_property_ui_text(prop, "Saturation", "");*/
+	RNA_def_property_ui_text(prop, "Saturation", "");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); */
 }
 
 static void rna_def_sequence(BlenderRNA *brna)
@@ -434,11 +464,13 @@
 	RNA_def_property_string_maxlength(prop, sizeof(((Sequence*)NULL)->name)-2);
 	RNA_def_property_ui_text(prop, "Name", "");
 	RNA_def_struct_name_property(srna, prop);
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
 
 	prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
 	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 	RNA_def_property_enum_items(prop, seq_type_items);
 	RNA_def_property_ui_text(prop, "Type", "");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 
 	//prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
 	//RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by this sequence.");
@@ -448,28 +480,32 @@
 	prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
 	RNA_def_property_ui_text(prop, "Selected", "");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
 
 	prop= RNA_def_property(srna, "left_handle_selected", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LEFTSEL);
 	RNA_def_property_ui_text(prop, "Left Handle Selected", "");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
 
 	prop= RNA_def_property(srna, "right_handle_selected", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_RIGHTSEL);
 	RNA_def_property_ui_text(prop, "Right Handle Selected", "");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
 
 	prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MUTE);
 	RNA_def_property_ui_text(prop, "Mute", "");
-	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 
 	prop= RNA_def_property(srna, "frame_locked", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_IPO_FRAME_LOCKED);
 	RNA_def_property_ui_text(prop, "Frame Locked", "Lock the animation curve to the global frame counter.");
-	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
 
 	prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LOCK);
 	RNA_def_property_ui_text(prop, "Lock", "Lock strip so that it can't be transformed.");
+	RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
 
 	/* strip positioning */
 
@@ -477,76 +513,76 @@
 	RNA_def_property_int_sdna(prop, NULL, "len");
 	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);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list