From f7bee258c609425a96b085bae4773662e374cb5b Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 11 Mar 2026 18:37:35 +0500 Subject: [PATCH] Linked models - add description for georeferencing indicator Example - https://files.catbox.moe/bkn9pn.png --- src/bonsai/bonsai/bim/module/project/prop.py | 8 ++++---- src/bonsai/bonsai/bim/module/project/ui.py | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/project/prop.py b/src/bonsai/bonsai/bim/module/project/prop.py index 5524f7efa7..5ba0cf6f28 100644 --- a/src/bonsai/bonsai/bim/module/project/prop.py +++ b/src/bonsai/bonsai/bim/module/project/prop.py @@ -230,11 +230,11 @@ class Link(PropertyGroup): ) georeferenced: EnumProperty( name="Georeferenced", - description="Georeferencing status: compatibility between host and linked model", + description="Georeferencing status, compatibility between host and linked model", items=[ - ("NONE", "No Georef", "Linked model has no georeferencing"), - ("NOT_COMPATIBLE", "Not Compatible", "Has geo data but CRS differ from host"), - ("FULL_COMPATIBLE", "Full Compatible", "Both CRS name and vertical datum match host"), + ("NONE", "No Georef", "Linked model has no georeferencing", "QUESTION", 0), + ("NOT_COMPATIBLE", "Not Compatible", "Has geo data but CRS differ from host", "ERROR", 1), + ("FULL_COMPATIBLE", "Full Compatible", "Both CRS name and vertical datum match host", "WORLD", 2), ], default="NONE", ) diff --git a/src/bonsai/bonsai/bim/module/project/ui.py b/src/bonsai/bonsai/bim/module/project/ui.py index d86dd3cf5b..a39102c907 100644 --- a/src/bonsai/bonsai/bim/module/project/ui.py +++ b/src/bonsai/bonsai/bim/module/project/ui.py @@ -619,12 +619,14 @@ class BIM_UL_links(UIList): ): row = layout.row(align=True) if item.is_loaded: - if item.georeferenced == "NONE": - row.label(text="", icon="QUESTION") - elif item.georeferenced == "NOT_COMPATIBLE": - row.label(text="", icon="ERROR") - elif item.georeferenced == "FULL_COMPATIBLE": - row.label(text="", icon="WORLD") + from bonsai.bim.module.project.prop import Link + + s = Link.bl_rna + geo_prop = s.properties["georeferenced"] + assert isinstance(geo_prop, bpy.types.EnumProperty) + enum_item = geo_prop.enum_items[item.georeferenced] + op = row.operator("bim.show_description", text="", icon=enum_item.icon, emboss=False) + op.description = f"{geo_prop.description}\n{enum_item.name}: {enum_item.description}" if item.has_transformation: row.label(text="", icon="OBJECT_ORIGIN")