Exports now automatically detect curve representations

This commit is contained in:
Dion Moult
2020-08-16 12:54:41 +10:00
parent b7bb7815ad
commit 31c349b0f1
3 changed files with 8 additions and 4 deletions
@@ -1086,7 +1086,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': mesh.BIMMeshProperties.is_wireframe if hasattr(mesh, 'BIMMeshProperties') else False,
'is_wireframe': self.is_wireframe_mesh(mesh),
'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,
@@ -1094,6 +1094,13 @@ class IfcParser():
'attributes': {'Name': mesh.name}
}
def is_wireframe_mesh(self, mesh):
if isinstance(mesh, bpy.types.Mesh) and not mesh.polygons:
return True
if isinstance(mesh, bpy.types.Curve) and not mesh.bevel_object and not mesh.bevel_depth:
return True
return False
def is_mesh_context_sensitive(self, name):
return '/' in name \
and ( \
@@ -1290,7 +1290,6 @@ class RepresentationItem(PropertyGroup):
class BIMMeshProperties(PropertyGroup):
is_wireframe: BoolProperty(name="Is Wireframe")
is_native: BoolProperty(name="Is Native", default=False)
is_swept_solid: BoolProperty(name="Is Swept Solid")
swept_solids: CollectionProperty(name="Swept Solids", type=SweptSolid)
@@ -589,8 +589,6 @@ class BIM_PT_mesh(Panel):
row = layout.row()
row.prop(props, 'is_parametric')
row = layout.row()
row.prop(props, 'is_wireframe')
row = layout.row()
row.prop(props, 'is_native')
row = layout.row()
row.prop(props, 'is_swept_solid')