clash ui - expose clash type to UI

Example - https://imgur.com/a/Wdyg3pn
This commit is contained in:
Andrej730
2025-05-23 14:04:36 +05:00
parent 29bd89324a
commit deae4e659b
3 changed files with 11 additions and 1 deletions
@@ -30,6 +30,7 @@ from bpy.props import (
FloatVectorProperty,
CollectionProperty,
)
from ifcopenshell.geom.main import ClashType, CLASH_TYPE_ITEMS
from mathutils import Vector
from typing import TYPE_CHECKING, Literal, Union
@@ -60,6 +61,10 @@ class Clash(PropertyGroup):
b_global_id: StringProperty(name="B")
a_name: StringProperty(name="A Name")
b_name: StringProperty(name="B Name")
clash_type: EnumProperty( # pyright: ignore[reportRedeclaration]
name="Clash Type",
items=tuple((i, i, "") for i in CLASH_TYPE_ITEMS),
)
status: BoolProperty(
name="Status",
description="Clash status, not stored anywhere - currently just displayed in UI for convenience.",
@@ -71,6 +76,7 @@ class Clash(PropertyGroup):
b_global_id: str
a_name: str
b_name: str
clash_type: ClashType
status: bool
+4 -1
View File
@@ -264,9 +264,12 @@ class BIM_UL_clashes(bpy.types.UIList):
active_propname,
) -> None:
if item:
row = layout.row(align=True)
row = layout.row(align=False)
row.label(text=str(item.a_name), translate=False, icon="NONE", icon_value=0)
row.label(text=str(item.b_name), translate=False, icon="NONE", icon_value=0)
col = row.column()
col.enabled = False
col.prop(item, "clash_type", text="")
row.prop(item, "status", text="")
else:
layout.label(text="", translate=False)
+1
View File
@@ -108,6 +108,7 @@ class Clash(bonsai.core.tool.Clash):
blender_clash.b_global_id = clash["b_global_id"]
blender_clash.a_name = "{}/{}".format(clash["a_ifc_class"], clash["a_name"])
blender_clash.b_name = "{}/{}".format(clash["b_ifc_class"], clash["b_name"])
blender_clash.clash_type = clash["type"]
blender_clash.status = False if not "status" in clash else clash["status"]
clash_set.clashes_loaded = True