Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/object/object_remesh.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_remesh.cc b/source/blender/editors/object/object_remesh.cc
index 39416a5fbe3..b65e76a5031 100644
--- a/source/blender/editors/object/object_remesh.cc
+++ b/source/blender/editors/object/object_remesh.cc
@@ -40,6 +40,7 @@
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_shrinkwrap.h"
+#include "BKE_unit.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
@@ -282,7 +283,7 @@ static void voxel_size_parallel_lines_draw(uint pos3d,
immEnd();
}
-static void voxel_size_edit_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *arg)
+static void voxel_size_edit_draw(const bContext *C, ARegion *UNUSED(ar), void *arg)
{
VoxelSizeEditCustomData *cd = static_cast<VoxelSizeEditCustomData *>(arg);
@@ -338,8 +339,9 @@ static void voxel_size_edit_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar),
short fstyle_points = fstyle->points;
char str[VOXEL_SIZE_EDIT_MAX_STR_LEN];
short strdrawlen = 0;
-
- BLI_snprintf(str, VOXEL_SIZE_EDIT_MAX_STR_LEN, "%.4f", cd->voxel_size);
+ Scene *scene = CTX_data_scene(C);
+ UnitSettings *unit = &scene->unit;
+ BKE_unit_value_as_string(str, VOXEL_SIZE_EDIT_MAX_STR_LEN, (double)(cd->voxel_size * unit->scale_length), 4, B_UNIT_LENGTH, unit, true);
strdrawlen = BLI_strlen_utf8(str);
immUnbindProgram();