From 0e3fa0b7618fa86e97c5f46ae7208c082fd26eb7 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 26 Aug 2014 12:04:24 +0200 Subject: Fix T41590: When scene scale is not 1.0, and units are "None," Blender assumes translations are in meters. Turned out there were several issues in handling of scale parameter by numinput. Fixed that by factorizing more some code in common with 'usual' numbuttons eval code (new `bUnit_getScaleUnit()` helper will return valid scaled value, depending on given system and type). Now, numinput behaves as expected - using default unit amended by scale in case no unit is given (i.e. entering '20' with a scale of 0.01 will give you 20cm, and '20cm' as well!). --- source/blender/editors/mesh/editmesh_inset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/mesh/editmesh_inset.c') diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c index 4a552d0fbd3..a4942d01671 100644 --- a/source/blender/editors/mesh/editmesh_inset.c +++ b/source/blender/editors/mesh/editmesh_inset.c @@ -90,7 +90,7 @@ static void edbm_inset_update_header(wmOperator *op, bContext *C) if (sa) { char flts_str[NUM_STR_REP_LEN * 2]; if (hasNumInput(&opdata->num_input)) - outputNumInput(&opdata->num_input, flts_str, sce->unit.scale_length); + outputNumInput(&opdata->num_input, flts_str, &sce->unit); else { BLI_snprintf(flts_str, NUM_STR_REP_LEN, "%f", RNA_float_get(op->ptr, "thickness")); BLI_snprintf(flts_str + NUM_STR_REP_LEN, NUM_STR_REP_LEN, "%f", RNA_float_get(op->ptr, "depth")); -- cgit v1.2.3