mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 23:36:20 +00:00
You can now bake parametric geometry to meshes
This commit is contained in:
@@ -225,6 +225,7 @@ if bpy is not None:
|
|||||||
operator.RewindInspector,
|
operator.RewindInspector,
|
||||||
operator.RefreshDrawingList,
|
operator.RefreshDrawingList,
|
||||||
operator.GetRepresentationIfcParameters,
|
operator.GetRepresentationIfcParameters,
|
||||||
|
operator.BakeParametricGeometry,
|
||||||
operator.UpdateIfcRepresentation,
|
operator.UpdateIfcRepresentation,
|
||||||
operator.SetBlenderClashSetA,
|
operator.SetBlenderClashSetA,
|
||||||
operator.SetBlenderClashSetB,
|
operator.SetBlenderClashSetB,
|
||||||
|
|||||||
@@ -4712,6 +4712,22 @@ class GetRepresentationIfcParameters(bpy.types.Operator):
|
|||||||
return c.ifc_definition_id or None
|
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):
|
class UpdateIfcRepresentation(bpy.types.Operator):
|
||||||
bl_idname = "bim.update_ifc_representation"
|
bl_idname = "bim.update_ifc_representation"
|
||||||
bl_label = "Update IFC Representation"
|
bl_label = "Update IFC Representation"
|
||||||
|
|||||||
@@ -814,6 +814,8 @@ class BIM_PT_mesh(Panel):
|
|||||||
layout.label(text="IFC Parameters:")
|
layout.label(text="IFC Parameters:")
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.operator("bim.get_representation_ifc_parameters")
|
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):
|
for index, ifc_parameter in enumerate(props.ifc_parameters):
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(ifc_parameter, "name", text="")
|
row.prop(ifc_parameter, "name", text="")
|
||||||
|
|||||||
Reference in New Issue
Block a user