mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Linked models - add description for georeferencing indicator
Example - https://files.catbox.moe/bkn9pn.png
This commit is contained in:
@@ -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",
|
||||
)
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user