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(
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",
)
+8 -6
View File
@@ -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")