From 9807c2bedfc7f62aa33b00aeeb5f716829d0f82a Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 2 Dec 2025 16:04:47 +0500 Subject: [PATCH] Fix possible crash on `bim.split_along_edge` #7394 --- src/bonsai/bonsai/bim/module/geometry/operator.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/bim/module/geometry/operator.py b/src/bonsai/bonsai/bim/module/geometry/operator.py index 174406a5da..e6d8383322 100644 --- a/src/bonsai/bonsai/bim/module/geometry/operator.py +++ b/src/bonsai/bonsai/bim/module/geometry/operator.py @@ -598,7 +598,11 @@ class UpdateRepresentation(bpy.types.Operator, tool.Ifc.Operator): tool.Material.ensure_material_unassigned([element_type]) ifcopenshell.api.material.unassign_material(self.file, products=[product]) tool.Material.ensure_material_unassigned([product]) - data = obj.data # Required after ensure_material_unassigned + + # Required after ensure_material_unassigned, since data might be recreated. + data = obj.data + assert tool.Geometry.is_data_supported_for_adding_representation(data) + mprops = tool.Geometry.get_mesh_props(data) else: # These objects are parametrically based on an axis and should not be modified as a mesh if extrusion := tool.Model.get_extrusion(old_representation):