[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23098] branches/blender2.5/blender/source /blender/makesrna/intern/rna_nodetree.c: 2.5 Node RNA:

Thomas Dinges dingto at gmx.de
Thu Sep 10 03:14:24 CEST 2009


Revision: 23098
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23098
Author:   dingto
Date:     2009-09-10 03:14:21 +0200 (Thu, 10 Sep 2009)

Log Message:
-----------
2.5 Node RNA:

* Added Property ranges for Nodes. 

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c	2009-09-10 00:32:59 UTC (rev 23097)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c	2009-09-10 01:14:21 UTC (rev 23098)
@@ -396,6 +396,7 @@
 	
 	prop = RNA_def_property(srna, "premul", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "x");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "Premul", "Mix Factor");
 }
 
@@ -419,38 +420,46 @@
 	
 	prop = RNA_def_property(srna, "sizex", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "sizex");
+	RNA_def_property_range(prop, 0, 256);
 	RNA_def_property_ui_text(prop, "Size X", "");
 	
 	prop = RNA_def_property(srna, "sizey", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "sizey");
+	RNA_def_property_range(prop, 1, 256);
 	RNA_def_property_ui_text(prop, "Size Y", "");
 	
 	prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "samples");
+	RNA_def_property_range(prop, 1, 256);
 	RNA_def_property_ui_text(prop, "Samples", "");
 	
 	prop = RNA_def_property(srna, "max_speed", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "maxspeed");
+	RNA_def_property_range(prop, 1, 1024);
 	RNA_def_property_ui_text(prop, "Max Speed", "");
 	
 	prop = RNA_def_property(srna, "min_speed", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "minspeed");
+	RNA_def_property_range(prop, 1, 1024);
 	RNA_def_property_ui_text(prop, "Min Speed", "");
-	
+
 	prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "relative", 1);
 	RNA_def_property_ui_text(prop, "Relative", "");
 	
 	prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "fac");
+	RNA_def_property_range(prop, 0.0f, 2.0f);
 	RNA_def_property_ui_text(prop, "Factor", "");
 	
 	prop = RNA_def_property(srna, "factor_x", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "percentx");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "Relative Size X", "");
 	
 	prop = RNA_def_property(srna, "factor_y", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "percenty");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "Relative Size Y", "");
 	
 	prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
@@ -506,10 +515,12 @@
 	
 	prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "loc");
+	RNA_def_property_range(prop, -1000.0f, 1000.0f);
 	RNA_def_property_ui_text(prop, "Offset", "");
 	
 	prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "size");
+	RNA_def_property_range(prop, -1000.0f, 1000.0f);
 	RNA_def_property_ui_text(prop, "Size", "");
 	
 	prop = RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE);
@@ -522,10 +533,12 @@
 	
 	prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "min");
+	RNA_def_property_range(prop, -1000.0f, 1000.0f);
 	RNA_def_property_ui_text(prop, "Minimum", "");
 	
 	prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "max");
+	RNA_def_property_range(prop, -1000.0f, 1000.0f);
 	RNA_def_property_ui_text(prop, "Maximum", "");
 }
 
@@ -580,14 +593,17 @@
 	
 	prop = RNA_def_property(srna, "frames", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "frames");
+	RNA_def_property_range(prop, 1, MAXFRAMEF);
 	RNA_def_property_ui_text(prop, "Frames", "Number of images used in animation");
 	
 	prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "sfra");
+	RNA_def_property_range(prop, 1, MAXFRAMEF);
 	RNA_def_property_ui_text(prop, "Start Frame", "");
 	
 	prop = RNA_def_property(srna, "offset", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "offset");
+	RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF);
 	RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation");
 	
 	prop = RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE);
@@ -604,6 +620,7 @@
 	
 	prop = RNA_def_property(srna, "layer", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "layer");
+	RNA_def_property_range(prop, 0, 10000);
 	RNA_def_property_ui_text(prop, "Layer", "");
 	
 	/* } */
@@ -692,10 +709,12 @@
 	
 	prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "sfra");
+	RNA_def_property_range(prop, 1, MAXFRAMEF);
 	RNA_def_property_ui_text(prop, "Start Frame", "");
 	
 	prop = RNA_def_property(srna, "end", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "efra");
+	RNA_def_property_range(prop, 1, MAXFRAMEF);
 	RNA_def_property_ui_text(prop, "End Frame", "");
 }
 
@@ -748,18 +767,22 @@
 	
 	prop = RNA_def_property(srna, "tolerance1", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "t1");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "Channel 1 Tolerance", "");
 	
 	prop = RNA_def_property(srna, "tolerance2", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "t2");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "Channel 2 Tolerance", "");
 	
 	prop = RNA_def_property(srna, "tolerance3", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "t3");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "Channel 3 Tolerance", "");
 	
 	prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "fstrength");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "Falloff", "");
 }
 
@@ -783,6 +806,7 @@
 	
 	prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "t1");
+	RNA_def_property_range(prop, 0.0f, 0.5f);
 	RNA_def_property_ui_text(prop, "Amount", "How much the selected channel is affected by");
 }
 
@@ -794,22 +818,27 @@
 	
 	prop = RNA_def_property(srna, "acceptance", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "t1");
+	RNA_def_property_range(prop, 1.0f, 80.0f);
 	RNA_def_property_ui_text(prop, "Acceptance", "Tolerance for a color to be considered a keying color");
 	
 	prop = RNA_def_property(srna, "cutoff", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "t2");
+	RNA_def_property_range(prop, 0.0f, 30.0f);
 	RNA_def_property_ui_text(prop, "Cutoff", "Tolerance below which colors will be considered as exact matches");
 
 	prop = RNA_def_property(srna, "lift", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "fsize");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "Lift", "Alpha lift");
 	
 	prop = RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "fstrength");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "Gain", "Alpha gain");
 	
 	prop = RNA_def_property(srna, "shadow_adjust", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "t3");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "Shadow Adjust", "Adjusts the brightness of any shadows captured");
 	
 	/* TODO: 
@@ -844,10 +873,12 @@
 	
 	prop = RNA_def_property(srna, "high", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "t1");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "High", "Values higher than this setting are 100% opaque");
 	
 	prop = RNA_def_property(srna, "low", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "t2");
+	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "Low", "Values lower than this setting are 100% keyed");
 	
 	/* TODO:
@@ -889,8 +920,9 @@
 	RNA_def_property_ui_text(prop, "Axis", "");
 	
 	/* TODO: percentage */
-	prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
+	prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_PERCENTAGE);
 	RNA_def_property_float_sdna(prop, NULL, "custom1");
+	RNA_def_property_range(prop, 0.0f, 100.0f);
 	RNA_def_property_ui_text(prop, "Factor", "");
 }
 
@@ -900,6 +932,7 @@
 	
 	prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "custom1");
+	RNA_def_property_range(prop, 0, 10000);
 	RNA_def_property_ui_text(prop, "Index", "Pass index number to convert to alpha");
 }
 
@@ -908,8 +941,9 @@
 	PropertyRNA *prop;
 	
 	/* TODO: percentage */
-	prop = RNA_def_property(srna, "alpha", PROP_INT, PROP_NONE);
+	prop = RNA_def_property(srna, "alpha", PROP_INT, PROP_PERCENTAGE);
 	RNA_def_property_int_sdna(prop, NULL, "custom1");
+	RNA_def_property_range(prop, 0, 100);
 	RNA_def_property_ui_text(prop, "Alpha", "");
 }
 
@@ -938,6 +972,7 @@
 	/* TODO: angle in degrees */		
 	prop = RNA_def_property(srna, "angle", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "rotation");
+	RNA_def_property_range(prop, 0, 90);
 	RNA_def_property_ui_text(prop, "Angle", "Bokeh shape rotation offset in degrees");
 	
 	prop = RNA_def_property(srna, "gamma_correction", PROP_BOOLEAN, PROP_NONE);
@@ -947,14 +982,17 @@
 	/* TODO */
 	prop = RNA_def_property(srna, "f_stop", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "fstop");
+	RNA_def_property_range(prop, 0.0f, 128.0f);
 	RNA_def_property_ui_text(prop, "fStop", "Amount of focal blur, 128=infinity=perfect focus, half the value doubles the blur radius");
 	
 	prop = RNA_def_property(srna, "max_blur", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "maxblur");
+	RNA_def_property_range(prop, 0.0f, 10000.0f);
 	RNA_def_property_ui_text(prop, "Max Blur", "blur limit, maximum CoC radius, 0=no limit");
 	
 	prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "bthresh");
+	RNA_def_property_range(prop, 0.0f, 100.0f);
 	RNA_def_property_ui_text(prop, "Threshold", "CoC radius threshold, prevents background bleed on in-focus midground, 0=off");
 	

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list