From 681083e757729e0fb46850b9ec52c0837b8a7317 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Wed, 9 Sep 2020 23:20:01 +1000 Subject: [PATCH] Fix bug in autodetection of wireframe meshes in case you use a modifier --- src/ifcblenderexport/blenderbim/bim/export_ifc.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ifcblenderexport/blenderbim/bim/export_ifc.py b/src/ifcblenderexport/blenderbim/bim/export_ifc.py index fdedae2da7..6293013958 100644 --- a/src/ifcblenderexport/blenderbim/bim/export_ifc.py +++ b/src/ifcblenderexport/blenderbim/bim/export_ifc.py @@ -1097,7 +1097,7 @@ class IfcParser(): 'is_point_cloud': self.is_point_cloud(obj), 'is_structural': self.is_structural(obj), 'is_text': isinstance(mesh, bpy.types.TextCurve), - 'is_wireframe': self.is_wireframe_mesh(mesh), + 'is_wireframe': self.is_wireframe_mesh(mesh, obj), 'is_native': mesh.BIMMeshProperties.is_native if hasattr(mesh, 'BIMMeshProperties') else False, 'is_swept_solid': mesh.BIMMeshProperties.is_swept_solid if hasattr(mesh, 'BIMMeshProperties') else False, 'is_generated': False, @@ -1105,9 +1105,12 @@ class IfcParser(): 'attributes': {'Name': mesh.name} } - def is_wireframe_mesh(self, mesh): + def is_wireframe_mesh(self, mesh, obj): if isinstance(mesh, bpy.types.Mesh) and not mesh.polygons: - return True + modifiers = [m.type for m in obj.modifiers] + # SCREW and SKIN can create faces, so it is not a wireframe mesh + if 'SCREW' not in modifiers and 'SKIN' not in modifiers: + return True if isinstance(mesh, bpy.types.Curve) and not mesh.bevel_object and not mesh.bevel_depth: return True return False