From 6da7e18f5028ac03792213068f085adc5fcfd2e1 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 9 Sep 2024 12:11:04 +0500 Subject: [PATCH] Fix error adding typed text annotations #5300 Apparently it's part of #4832, previously creating a shape for IfcTypeProduct with literals would error, we ignored the error and type product end up being an empty. After 0.8.0 create_shape for literals creates an empty shape (0 verts) and we need to skip it, otherwise there would be an empty mesh representaiton. --- src/bonsai/bonsai/bim/import_ifc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/bim/import_ifc.py b/src/bonsai/bonsai/bim/import_ifc.py index ac8f639530..5fde08e638 100644 --- a/src/bonsai/bonsai/bim/import_ifc.py +++ b/src/bonsai/bonsai/bim/import_ifc.py @@ -570,7 +570,10 @@ class IfcImporter: mesh = self.meshes.get(mesh_name) if mesh is None: shape = tool.Loader.create_generic_shape(representation) - if shape: + # Skip elements without geometry - e.g. annotations with IfcTextLiterals. + if shape and not shape.verts_buffer: + pass + elif shape: mesh = self.create_mesh(element, shape) tool.Loader.link_mesh(shape, mesh) self.meshes[mesh_name] = mesh