From c0c4d9c14ce9e0990cfc372ead875e4629298d0a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 10 Dec 2010 23:31:03 +0000 Subject: [PATCH] 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. --- source/blender/editors/space_view3d/view3d_buttons.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index eb6965932a2..1c400ee1ff8 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -281,6 +281,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float 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 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float 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 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float 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);