[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30426] trunk/blender/source/blender/ makesrna/intern/rna_actuator.c: Logic Editor: fix for float values steps and precision (reported by Mal Duffin (malCanDo ) over email)

Dalai Felinto dfelinto at gmail.com
Sat Jul 17 04:29:35 CEST 2010


Revision: 30426
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30426
Author:   dfelinto
Date:     2010-07-17 04:29:29 +0200 (Sat, 17 Jul 2010)

Log Message:
-----------
Logic Editor: fix for float values steps and precision (reported by Mal Duffin (malCanDo) over email)
The UI wasn't working.
+ renaming motion blur rna to motion_blur_factor
+ fixing "using wrong dna" for min_y constraint actuator RNA

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

Modified: trunk/blender/source/blender/makesrna/intern/rna_actuator.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_actuator.c	2010-07-17 00:38:34 UTC (rev 30425)
+++ trunk/blender/source/blender/makesrna/intern/rna_actuator.c	2010-07-17 02:29:29 UTC (rev 30426)
@@ -606,100 +606,100 @@
 
 	prop= RNA_def_property(srna, "proportional_coefficient", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "forcerot[0]");
-	RNA_def_property_ui_range(prop, 0.0, 200.0, 1.0, 0.1);
+	RNA_def_property_ui_range(prop, 0.0, 200.0, 10, 2);
 	RNA_def_property_ui_text(prop, "Proportional Coefficient", "Typical value is 60x integral coefficient");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "integral_coefficient", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "forcerot[1]");
-	RNA_def_property_ui_range(prop, 0.0, 3.0, 0.1, 0.01);
+	RNA_def_property_ui_range(prop, 0.0, 3.0, 10, 2);
 	RNA_def_property_float_funcs(prop, NULL, "rna_ObjectActuator_integralcoefficient_set", NULL);
 	RNA_def_property_ui_text(prop, "Integral Coefficient", "Low value (0.01) for slow response, high value (0.5) for fast response");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "derivate_coefficient", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "forcerot[2]");
-	RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+	RNA_def_property_ui_range(prop, -100.0, 100.0, 10, 2);
 	RNA_def_property_ui_text(prop, "Derivate Coefficient", "Not required, high values can cause instability");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	/* Servo Limit */
 	prop= RNA_def_property(srna, "force_max_x", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "dloc[0]");
-	RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+	RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "force_min_x", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "drot[0]");
-	RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+	RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Min", "Set the lower limit for force");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "force_max_y", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_float_sdna(prop, NULL, "dloc[0]");
-	RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+	RNA_def_property_float_sdna(prop, NULL, "dloc[1]");
+	RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "force_min_y", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "drot[1]");
-	RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+	RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Min", "Set the lower limit for force");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "force_max_z", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "dloc[2]");
-	RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+	RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "force_min_z", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "drot[2]");
-	RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+	RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Min", "Set the lower limit for force");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	/* floats 3 Arrays*/
-	prop= RNA_def_property(srna, "loc", PROP_FLOAT, PROP_TRANSLATION);
+	prop= RNA_def_property(srna, "loc", PROP_FLOAT, PROP_XYZ);
 	RNA_def_property_float_sdna(prop, NULL, "dloc");
 	RNA_def_property_array(prop, 3);
-	RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
+	RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
 	RNA_def_property_ui_text(prop, "Loc", "Sets the location");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
-	prop= RNA_def_property(srna, "rot", PROP_FLOAT, PROP_TRANSLATION);
+	prop= RNA_def_property(srna, "rot", PROP_FLOAT, PROP_XYZ);
 	RNA_def_property_float_sdna(prop, NULL, "drot");
 	RNA_def_property_array(prop, 3);
-	RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
+	RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
 	RNA_def_property_ui_text(prop, "Rot", "Sets the rotation");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
-	prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_TRANSLATION);
+	prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_XYZ);
 	RNA_def_property_float_sdna(prop, NULL, "forceloc");
 	RNA_def_property_array(prop, 3);
-	RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
+	RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
 	RNA_def_property_ui_text(prop, "Force", "Sets the force");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
-	prop= RNA_def_property(srna, "torque", PROP_FLOAT, PROP_TRANSLATION);
+	prop= RNA_def_property(srna, "torque", PROP_FLOAT, PROP_XYZ);
 	RNA_def_property_float_sdna(prop, NULL, "forcerot");
 	RNA_def_property_array(prop, 3);
-	RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
+	RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
 	RNA_def_property_ui_text(prop, "Torque", "Sets the torque");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
-	prop= RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_TRANSLATION);
+	prop= RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_XYZ);
 	RNA_def_property_float_sdna(prop, NULL, "linearvelocity");
 	RNA_def_property_array(prop, 3);
-	RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
+	RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
 	RNA_def_property_ui_text(prop, "Linear Velocity", "Sets the linear velocity (in Servo mode it sets the target relative linear velocity, it will be achieved by automatic application of force. Null velocity is a valid target)");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
-	prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_TRANSLATION);
+	prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_XYZ);
 	RNA_def_property_float_sdna(prop, NULL, "angularvelocity");
 	RNA_def_property_array(prop, 3);
-	RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
+	RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
 	RNA_def_property_ui_text(prop, "Angular Velocity", "Sets the angular velocity");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 	
@@ -848,17 +848,17 @@
 
 	/* floats */
 	prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_ui_range(prop, 0.0, 20.0, 0.1, 0.1);
+	RNA_def_property_ui_range(prop, 0.0, 20.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Height", "");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_ui_range(prop, 0.0, 20.0, 0.1, 0.1);
+	RNA_def_property_ui_range(prop, 0.0, 20.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Min", "");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_ui_range(prop, 0.0, 20.0, 0.1, 0.1);
+	RNA_def_property_ui_range(prop, 0.0, 20.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Max", "");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
@@ -902,62 +902,62 @@
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 0.01);
+	RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
 	RNA_def_property_range(prop, 0.0, 2.0);
 	RNA_def_property_ui_text(prop, "Volume", "Sets the initial volume of the sound");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_ui_range(prop, -12.0, 12.0, 1.0, 0.1);
+	RNA_def_property_ui_range(prop, -12.0, 12.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Pitch", "Sets the pitch of the sound");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 	
 	/* floats - 3D Parameters */
 	prop= RNA_def_property(srna, "minimum_gain_3d", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "sound3D.min_gain");
-	RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 0.01);
+	RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Minimum Gain", "The minimum gain of the sound, no matter how far it is away");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "maximum_gain_3d", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "sound3D.max_gain");
-	RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 0.01);
+	RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Maximum Gain", "The maximum gain of the sound, no matter how near it is");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "reference_distance_3d", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "sound3D.reference_distance");
-	RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1.0, 0.01);
+	RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1, 2);
 	RNA_def_property_ui_text(prop, "Reference Distance", "The distance where the sound has a gain of 1.0");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 	
 	prop= RNA_def_property(srna, "max_distance_3d", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "sound3D.max_distance");
-	RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1.0, 0.01);
+	RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1, 2);
 	RNA_def_property_ui_text(prop, "Maximum Distance", "The maximum distance at which you can hear the sound");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "rolloff_factor_3d", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "sound3D.rolloff_factor");

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list