[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30678] trunk/blender/source/blender: [ #22873] Snap to increment isn' t working that expected when Units set to Metric or Imperial - minor

Campbell Barton ideasman42 at gmail.com
Sat Jul 24 02:24:58 CEST 2010


Revision: 30678
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30678
Author:   campbellbarton
Date:     2010-07-24 02:24:58 +0200 (Sat, 24 Jul 2010)

Log Message:
-----------
[#22873] Snap to increment isn't working that expected when Units set to Metric or Imperial - minor
- pick the closest unit that matches the existing step size.
- set the distance subtype on some camera flags.
- commented mesh flag 'ME_ISDONE' its nolonger used.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface.c
    trunk/blender/source/blender/makesdna/DNA_mesh_types.h
    trunk/blender/source/blender/makesrna/intern/rna_camera.c
    trunk/blender/source/blender/makesrna/intern/rna_modifier.c

Modified: trunk/blender/source/blender/editors/interface/interface.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface.c	2010-07-23 23:48:21 UTC (rev 30677)
+++ trunk/blender/source/blender/editors/interface/interface.c	2010-07-24 00:24:58 UTC (rev 30678)
@@ -1464,13 +1464,13 @@
 	bUnit_AsString(str, len_max, ui_get_but_scale_unit(but, value), precision, scene->unit.system, unit_type, do_split, pad);
 }
 
-static float ui_get_but_step_unit(uiBut *but, double value, float step_default)
+static float ui_get_but_step_unit(uiBut *but, float step_default)
 {
 	Scene *scene= CTX_data_scene((bContext *)but->block->evil_C);
 	int unit_type=  RNA_SUBTYPE_UNIT_VALUE(RNA_property_subtype(but->rnaprop));
 	float step;
 
-	step = bUnit_ClosestScalar(ui_get_but_scale_unit(but, value), scene->unit.system, unit_type);
+	step = bUnit_ClosestScalar(ui_get_but_scale_unit(but, step_default), scene->unit.system, unit_type);
 
 	if(step > 0.0) { /* -1 is an error value */
 		return (step/ui_get_but_scale_unit(but, 1.0))*100;
@@ -2563,7 +2563,7 @@
 
 	/* If this button uses units, calculate the step from this */
 	if(ui_is_but_unit(but))
-		but->a1= ui_get_but_step_unit(but, ui_get_but_val(but), but->a1);
+		but->a1= ui_get_but_step_unit(but, but->a1);
 
 	if(freestr)
 		MEM_freeN(str);

Modified: trunk/blender/source/blender/makesdna/DNA_mesh_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_mesh_types.h	2010-07-23 23:48:21 UTC (rev 30677)
+++ trunk/blender/source/blender/makesdna/DNA_mesh_types.h	2010-07-24 00:24:58 UTC (rev 30678)
@@ -128,7 +128,7 @@
 
 
 /* me->flag */
-#define ME_ISDONE		1
+/* #define ME_ISDONE		1 */
 #define ME_NOPUNOFLIP	2
 #define ME_TWOSIDED		4
 #define ME_UVEFFECT		8

Modified: trunk/blender/source/blender/makesrna/intern/rna_camera.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_camera.c	2010-07-23 23:48:21 UTC (rev 30677)
+++ trunk/blender/source/blender/makesrna/intern/rna_camera.c	2010-07-24 00:24:58 UTC (rev 30678)
@@ -84,13 +84,13 @@
 	RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view");
 	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
 
-	prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
+	prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
 	RNA_def_property_float_sdna(prop, NULL, "clipsta");
 	RNA_def_property_range(prop, 0.0f, FLT_MAX);
 	RNA_def_property_ui_text(prop, "Clip Start", "Camera near clipping distance");
 	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
 
-	prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE);
+	prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
 	RNA_def_property_float_sdna(prop, NULL, "clipend");
 	RNA_def_property_range(prop, 1.0f, FLT_MAX);
 	RNA_def_property_ui_text(prop, "Clip End", "Camera far clipping distance");
@@ -114,7 +114,7 @@
 	RNA_def_property_ui_text(prop, "Orthographic Scale", "Orthographic Camera scale (similar to zoom)");
 	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
 
-	prop= RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_NONE);
+	prop= RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_DISTANCE);
 	RNA_def_property_float_sdna(prop, NULL, "drawsize");
 	RNA_def_property_range(prop, 0.1f, 1000.0f);
 	RNA_def_property_ui_range(prop, 0.01, 100, 1, 1);
@@ -135,7 +135,7 @@
 	RNA_def_property_ui_text(prop, "Shift Y", "Perspective Camera vertical shift");
 	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
 
-	prop= RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_NONE);
+	prop= RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_DISTANCE);
 	RNA_def_property_float_sdna(prop, NULL, "YF_dofdist");
 	RNA_def_property_range(prop, 0.0f, 5000.0f);
 	RNA_def_property_ui_text(prop, "DOF Distance", "Distance to the focus point for depth of field");

Modified: trunk/blender/source/blender/makesrna/intern/rna_modifier.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_modifier.c	2010-07-23 23:48:21 UTC (rev 30677)
+++ trunk/blender/source/blender/makesrna/intern/rna_modifier.c	2010-07-24 00:24:58 UTC (rev 30678)
@@ -2061,7 +2061,7 @@
 	RNA_def_property_ui_text(prop, "Thickness", "Thickness of the shell");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
-	prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_DISTANCE);
+	prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_FACTOR);
 	RNA_def_property_float_sdna(prop, NULL, "offset_fac");
 	RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
 	RNA_def_property_ui_range(prop, -1, 1, 0.1, 4);





More information about the Bf-blender-cvs mailing list