From d22a0c7cb8150092f6d120ac9fc34fc378314e88 Mon Sep 17 00:00:00 2001 From: Cyril Waechter Date: Tue, 4 Jan 2022 03:04:06 +0100 Subject: [PATCH] Boundary geom creation : fix math + small ui fix (#1938) _Neo accidentally took the red pill so I transposed the matrix to make it blue_ * Fix how placement matrix of updated geometry is created. * Fix ui: was throwing an error when boundary had no `RelatedBuildingElement` --- src/blenderbim/blenderbim/bim/module/boundary/operator.py | 1 + src/blenderbim/blenderbim/bim/module/boundary/ui.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/blenderbim/blenderbim/bim/module/boundary/operator.py b/src/blenderbim/blenderbim/bim/module/boundary/operator.py index 73c198a472..a2395135c0 100644 --- a/src/blenderbim/blenderbim/bim/module/boundary/operator.py +++ b/src/blenderbim/blenderbim/bim/module/boundary/operator.py @@ -305,6 +305,7 @@ class UpdateBoundaryGeometry(bpy.types.Operator): matrix[0].xyz = i matrix[1].xyz = j matrix[2].xyz = k + matrix.transpose() matrix.translation = location settings = { diff --git a/src/blenderbim/blenderbim/bim/module/boundary/ui.py b/src/blenderbim/blenderbim/bim/module/boundary/ui.py index 6325f0f1d5..34c0bbf272 100644 --- a/src/blenderbim/blenderbim/bim/module/boundary/ui.py +++ b/src/blenderbim/blenderbim/bim/module/boundary/ui.py @@ -145,6 +145,10 @@ class BIM_PT_SpaceBoundaries(Panel): boundary_data = Data.boundaries[boundary_id] building_element = self.ifc_file.by_id(boundary_data["RelatedBuildingElement"]) row = self.layout.row() - row.label(text=f"{boundary_id} > {building_element.is_a()}/{building_element.Name}", icon="GHOST_ENABLED") + if building_element: + bld_el_description = f"{building_element.is_a()}/{building_element.Name}" + else: + bld_el_description = None + row.label(text=f"{boundary_id} > {bld_el_description}", icon="GHOST_ENABLED") op = row.operator("bim.load_boundary", text="", icon="RESTRICT_SELECT_OFF") op.boundary_id = boundary_id