Linked models - add description for georeferencing indicator

Example - https://files.catbox.moe/bkn9pn.png
This commit is contained in:
Andrej730
2026-03-11 18:37:35 +05:00
parent 0585f8716a
commit f7bee258c6
2 changed files with 12 additions and 10 deletions
+4 -4
View File
@@ -230,11 +230,11 @@ class Link(PropertyGroup):
) )
georeferenced: EnumProperty( georeferenced: EnumProperty(
name="Georeferenced", name="Georeferenced",
description="Georeferencing status: compatibility between host and linked model", description="Georeferencing status, compatibility between host and linked model",
items=[ items=[
("NONE", "No Georef", "Linked model has no georeferencing"), ("NONE", "No Georef", "Linked model has no georeferencing", "QUESTION", 0),
("NOT_COMPATIBLE", "Not Compatible", "Has geo data but CRS differ from host"), ("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"), ("FULL_COMPATIBLE", "Full Compatible", "Both CRS name and vertical datum match host", "WORLD", 2),
], ],
default="NONE", default="NONE",
) )
+8 -6
View File
@@ -619,12 +619,14 @@ class BIM_UL_links(UIList):
): ):
row = layout.row(align=True) row = layout.row(align=True)
if item.is_loaded: if item.is_loaded:
if item.georeferenced == "NONE": from bonsai.bim.module.project.prop import Link
row.label(text="", icon="QUESTION")
elif item.georeferenced == "NOT_COMPATIBLE": s = Link.bl_rna
row.label(text="", icon="ERROR") geo_prop = s.properties["georeferenced"]
elif item.georeferenced == "FULL_COMPATIBLE": assert isinstance(geo_prop, bpy.types.EnumProperty)
row.label(text="", icon="WORLD") 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: if item.has_transformation:
row.label(text="", icon="OBJECT_ORIGIN") row.label(text="", icon="OBJECT_ORIGIN")