mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Allow people to maintain parametric modifiers, or bake the results
This commit is contained in:
@@ -215,6 +215,8 @@ class IfcParser():
|
||||
|
||||
def resolve_modifiers(self, product):
|
||||
obj = product['raw']
|
||||
if obj.data and not obj.data.BIMMeshProperties.is_parametric:
|
||||
return
|
||||
instance_objects = [(obj, {
|
||||
'location': obj.matrix_world.translation,
|
||||
'array_offset': Vector((0, 0, 0)),
|
||||
@@ -840,6 +842,7 @@ class IfcParser():
|
||||
'context': context,
|
||||
'subcontext': subcontext,
|
||||
'target_view': target_view,
|
||||
'is_parametric': mesh.BIMMeshProperties.is_parametric if hasattr(mesh, 'BIMMeshProperties') else False,
|
||||
'is_curve': isinstance(mesh, bpy.types.Curve),
|
||||
'is_point_cloud': self.is_point_cloud(obj),
|
||||
'is_structural': self.is_structural(obj),
|
||||
@@ -2166,6 +2169,8 @@ class IfcExporter():
|
||||
|
||||
def create_solid_representation(self, representation):
|
||||
mesh = representation['raw']
|
||||
if not representation['is_parametric']:
|
||||
mesh = representation['raw_object'].evaluated_get(bpy.context.evaluated_depsgraph_get()).to_mesh()
|
||||
self.create_vertices(mesh.vertices)
|
||||
for polygon in mesh.polygons:
|
||||
self.ifc_faces.append(self.file.createIfcFace([
|
||||
|
||||
@@ -505,3 +505,4 @@ class BIMMeshProperties(PropertyGroup):
|
||||
is_wireframe: BoolProperty(name="Is Wireframe")
|
||||
is_swept_solid: BoolProperty(name="Is Swept Solid")
|
||||
swept_solids: CollectionProperty(name="Swept Solids", type=SweptSolid)
|
||||
is_parametric: BoolProperty(name='Is Parametric', default=False)
|
||||
|
||||
@@ -142,6 +142,9 @@ class BIM_PT_mesh(Panel):
|
||||
row = layout.row()
|
||||
row.operator('bim.assign_context')
|
||||
|
||||
row = layout.row()
|
||||
row.prop(props, 'is_parametric')
|
||||
|
||||
row = layout.row()
|
||||
row.prop(props, 'is_wireframe')
|
||||
row = layout.row()
|
||||
|
||||
Reference in New Issue
Block a user