[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20797] branches/blender2.5/blender: patch from Xavier Thomas, color balance and proxy access both need to allocate structs when enabled.

Campbell Barton ideasman42 at gmail.com
Thu Jun 11 00:03:50 CEST 2009


Revision: 20797
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20797
Author:   campbellbarton
Date:     2009-06-11 00:03:50 +0200 (Thu, 11 Jun 2009)

Log Message:
-----------
patch from Xavier Thomas, color balance and proxy access both need to allocate structs when enabled.

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 20:50:23 UTC (rev 20796)
+++ branches/blender2.5/blender/release/ui/space_sequencer.py	2009-06-10 22:03:50 UTC (rev 20797)
@@ -144,6 +144,7 @@
 		st = context.space_data
 		
 		layout.column()
+		layout.itemO("SEQUENCER_OT_scene_strip_add", text="Scene")
 		layout.itemO("SEQUENCER_OT_movie_strip_add", text="Movie")
 		layout.item_booleanO("SEQUENCER_OT_movie_strip_add", "sound", True, text="Movie & Sound") # FFMPEG ONLY
 		layout.itemO("SEQUENCER_OT_image_strip_add", text="Image")
@@ -469,6 +470,16 @@
 		col.itemR(strip, "reverse_frames", text="Backwards")
 		
 		layout.itemR(strip, "use_color_balance")
+		if strip.color_balance: # TODO - need to add this somehow
+			col = layout.row()
+			
+			col.itemR(strip.color_balance, "lift")
+			col.itemR(strip.color_balance, "gamma")
+			col.itemR(strip.color_balance, "gain")
+			col = layout.row()
+			col.itemR(strip.color_balance, "inverse_lift")
+			col.itemR(strip.color_balance, "inverse_gamma")
+			col.itemR(strip.color_balance, "inverse_gain")
 
 class SEQUENCER_PT_proxy(SequencerButtonsPanel):
 	__label__ = "Proxy"
@@ -496,11 +507,11 @@
 		
 		layout = self.layout
 		
-		row = layout.row()
-		row.itemR(strip, "proxy_custom_directory")
+		flow = layout.column_flow()
+		flow.itemR(strip, "proxy_custom_directory")
 		if strip.proxy: # TODO - need to add this somehow
-			row.itemR(strip.proxy, "dir")
-			row.itemR(strip.proxy, "file")
+			flow.itemR(strip.proxy, "directory")
+			flow.itemR(strip.proxy, "file")
 
 
 class SEQUENCER_PT_view(SequencerButtonsPanel_Output):

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 20:50:23 UTC (rev 20796)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c	2009-06-10 22:03:50 UTC (rev 20797)
@@ -98,6 +98,39 @@
 	sort_seq(sce);
 }
 
+static int rna_SequenceEditor_use_color_balance_set(PointerRNA *ptr, int value)
+{
+	Sequence *seq= (Sequence*)ptr->data;
+	int c;
+	
+	if(value) {
+		seq->flag |= SEQ_USE_COLOR_BALANCE;
+		if(seq->strip->color_balance == NULL) {
+			seq->strip->color_balance = MEM_callocN(sizeof(struct StripColorBalance), "StripColorBalance");
+			for (c=0; c<3; c++) {
+				seq->strip->color_balance->lift[c] = 1.0f;
+				seq->strip->color_balance->gamma[c] = 1.0f;
+				seq->strip->color_balance->gain[c] = 1.0f;
+			}
+		}
+	} else {
+		seq->flag ^= SEQ_USE_COLOR_BALANCE;
+	}
+}
+
+static int rna_SequenceEditor_use_proxy_set(PointerRNA *ptr, int value)
+{
+	Sequence *seq= (Sequence*)ptr->data;
+	if(value) {
+		seq->flag |= SEQ_USE_PROXY;
+		if(seq->strip->proxy == NULL) {
+			seq->strip->proxy = MEM_callocN(sizeof(struct StripProxy), "StripProxy");
+		}
+	} else {
+		seq->flag ^= SEQ_USE_PROXY;
+	}
+}
+
 /* name functions that ignore the first two characters */
 static void rna_Sequence_name_get(PointerRNA *ptr, char *value)
 {
@@ -504,8 +537,8 @@
 
 	prop= RNA_def_property(srna, "use_color_balance", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_COLOR_BALANCE);
-	RNA_def_property_clear_flag(prop, PROP_EDITABLE); // allocate color balance
 	RNA_def_property_ui_text(prop, "Use Color Balance", "(3-Way color correction) on input.");
+	RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_color_balance_set");
 
 	prop= RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "strip->color_balance");
@@ -551,8 +584,8 @@
 
 	prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY);
-	RNA_def_property_clear_flag(prop, PROP_EDITABLE); // allocate proxy
 	RNA_def_property_ui_text(prop, "Use Proxy", "Use a preview proxy for this strip.");
+	RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_proxy_set");
 
 	prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "strip->proxy");





More information about the Bf-blender-cvs mailing list