You can now bake parametric geometry to meshes

This commit is contained in:
Dion Moult
2020-12-07 15:33:51 +11:00
parent 0d28e741fc
commit c1bbb1e721
3 changed files with 19 additions and 0 deletions
@@ -225,6 +225,7 @@ if bpy is not None:
operator.RewindInspector,
operator.RefreshDrawingList,
operator.GetRepresentationIfcParameters,
operator.BakeParametricGeometry,
operator.UpdateIfcRepresentation,
operator.SetBlenderClashSetA,
operator.SetBlenderClashSetB,
@@ -4712,6 +4712,22 @@ class GetRepresentationIfcParameters(bpy.types.Operator):
return c.ifc_definition_id or None
class BakeParametricGeometry(bpy.types.Operator):
bl_idname = "bim.bake_parametric_geometry"
bl_label = "Bake Parametric Geometry"
def execute(self, context):
obj = bpy.context.active_object
if "/" not in obj.data.name:
context, subcontext, target_view = ("Model", "Body", "MODEL_VIEW")
else:
context, subcontext, target_view = obj.data.name.split("/")[0:3]
for c in obj.BIMObjectProperties.representation_contexts:
if c.context == context and c.name == subcontext and c.target_view == target_view:
c.ifc_definition_id = 0
return {"FINISHED"}
class UpdateIfcRepresentation(bpy.types.Operator):
bl_idname = "bim.update_ifc_representation"
bl_label = "Update IFC Representation"
@@ -814,6 +814,8 @@ class BIM_PT_mesh(Panel):
layout.label(text="IFC Parameters:")
row = layout.row()
row.operator("bim.get_representation_ifc_parameters")
row = layout.row()
row.operator("bim.bake_parametric_geometry")
for index, ifc_parameter in enumerate(props.ifc_parameters):
row = layout.row(align=True)
row.prop(ifc_parameter, "name", text="")