Fix #5754. Cosmetic bug where UI was not refreshed when using advanced mode causing incomplete decorators to be drawn.

This commit is contained in:
Dion Moult
2025-01-20 00:25:29 +11:00
parent 5c058dff3e
commit 5769c0d442
2 changed files with 9 additions and 2 deletions
@@ -64,8 +64,11 @@ class GeoreferenceDecorator:
if not GeoreferenceData.is_loaded:
GeoreferenceData.load()
self.calculate_angles(context)
props = context.scene.BIMGeoreferenceProperties
if not props.model_origin: # If this is empty, no georeferencing data has been loaded.
return
self.calculate_angles(context)
e, n, h = [round(float(o), 7) for o in props.model_origin.split(",")]
if (operation := GeoreferenceData.data["coordinate_operation"]) and (scale := operation.get("Scale", None)):
e *= scale
@@ -175,6 +178,10 @@ class GeoreferenceDecorator:
if not GeoreferenceData.is_loaded:
GeoreferenceData.load()
props = context.scene.BIMGeoreferenceProperties
if not props.model_origin: # If this is empty, no georeferencing data has been loaded.
return
self.calculate_angles(context)
self.addon_prefs = tool.Blender.get_addon_preferences()
@@ -308,7 +315,6 @@ class GeoreferenceDecorator:
self.draw_batch("LINES", verts, decorator_color_special, edges)
self.draw_dashed_line(location * 3, location * 6, decorator_color_error)
props = context.scene.BIMGeoreferenceProperties
if props.has_blender_offset:
location = GeoreferenceData.data["local_origin"]["location"]
if location.length < 1000:
@@ -889,6 +889,7 @@ class LoadProjectElements(bpy.types.Operator):
tool.Project.set_default_context()
tool.Project.set_default_modeling_dimensions()
tool.Root.reload_grid_decorator()
bonsai.bim.handler.refresh_ui_data()
return {"FINISHED"}
def get_decomposition_elements(self):