Fix #2988. Imperial dimensions in viewport are now split between feet and inches.

This commit is contained in:
Dion Moult
2023-04-15 15:32:25 +10:00
parent ed7e5fb482
commit 156269a53f
2 changed files with 8 additions and 16 deletions
@@ -29,9 +29,9 @@ def refresh():
SheetsData.is_loaded = False SheetsData.is_loaded = False
SchedulesData.is_loaded = False SchedulesData.is_loaded = False
DrawingsData.is_loaded = False DrawingsData.is_loaded = False
AnnotationData.is_loaded = False
DecoratorData.data = {} DecoratorData.data = {}
DecoratorData.cut_cache = {} DecoratorData.cut_cache = {}
AnnotationData.is_loaded = False
class ProductAssignmentsData: class ProductAssignmentsData:
@@ -407,21 +407,13 @@ class BaseDecorator:
blf.disable(font_id, blf.ROTATION) blf.disable(font_id, blf.ROTATION)
def format_value(self, context, value): def format_value(self, context, value):
unit_system = context.scene.unit_settings.system return bpy.utils.units.to_string(
if unit_system == "IMPERIAL": context.scene.unit_settings.system,
precision = context.scene.BIMProperties.imperial_precision "LENGTH",
if precision == "NONE": value,
precision = 256 precision=4,
elif precision == "1": split_unit=context.scene.unit_settings.system == "IMPERIAL",
precision = 1 )
elif "/" in precision:
precision = int(precision.split("/")[1])
elif unit_system == "METRIC":
precision = 4
else:
return
return bpy.utils.units.to_string(unit_system, "LENGTH", value, precision=precision)
class DimensionDecorator(BaseDecorator): class DimensionDecorator(BaseDecorator):