[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33593] trunk/blender/source/blender/ editors/space_view3d/view3d_buttons.c: fix [#25170] The 3d view properties panel median values use Blender units when set to use imperial .

Campbell Barton ideasman42 at gmail.com
Sat Dec 11 00:31:04 CET 2010


Revision: 33593
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33593
Author:   campbellbarton
Date:     2010-12-11 00:31:03 +0100 (Sat, 11 Dec 2010)

Log Message:
-----------
fix [#25170] The 3d view properties panel median values use Blender units when set to use imperial.
unit settings were working for vertex location but not median selection.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/view3d_buttons.c

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_buttons.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_buttons.c	2010-12-10 19:34:42 UTC (rev 33592)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_buttons.c	2010-12-10 23:31:03 UTC (rev 33593)
@@ -281,6 +281,7 @@
 		mul_m4_v3(ob->obmat, median);
 	
 	if(block) {	// buttons
+		uiBut *but;
 		int but_y;
 		if((ob->parent) && (ob->partype == PARBONE))	but_y = 135;
 		else											but_y = 150;
@@ -291,7 +292,6 @@
 		
 		uiBlockBeginAlign(block);
 		if(tot==1) {
-			uiBut *but;
 			uiDefBut(block, LABEL, 0, "Vertex:",					0, 130, 200, 20, 0, 0, 0, 0, 0, "");
 			uiBlockBeginAlign(block);
 
@@ -327,9 +327,12 @@
 		else {
 			uiDefBut(block, LABEL, 0, "Median:",					0, 130, 200, 20, 0, 0, 0, 0, 0, "");
 			uiBlockBeginAlign(block);
-			uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:",		0, 110, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, "");
-			uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:",		0, 90, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, "");
-			uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:",		0, 70, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, "");
+			but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:",		0, 110, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, "");
+			uiButSetUnitType(but, PROP_UNIT_LENGTH);
+			but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:",		0, 90, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, "");
+			uiButSetUnitType(but, PROP_UNIT_LENGTH);
+			but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:",		0, 70, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, "");
+			uiButSetUnitType(but, PROP_UNIT_LENGTH);
 			if(totw==tot) {
 				uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:",	0, 50, 200, 20, &(tfp->ve_median[3]), 0.01, 100.0, 10, 3, "");
 				uiBlockEndAlign(block);





More information about the Bf-blender-cvs mailing list