Skip to content
This repository was archived by the owner on Nov 24, 2024. It is now read-only.

Commit ce6350a

Browse files
committed
New clean wireframes operator to easily apply edge split modifier to nicer drawings
1 parent b65c1e9 commit ce6350a

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

src/ifcblenderexport/blenderbim/bim/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@
230230
operator.SetBlenderClashSetA,
231231
operator.SetBlenderClashSetB,
232232
operator.ExecuteBlenderClash,
233+
operator.CleanWireframes,
233234
prop.StrProperty,
234235
prop.Attribute,
235236
prop.MaterialLayer,

src/ifcblenderexport/blenderbim/bim/operator.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4845,3 +4845,20 @@ def execute(self, context):
48454845
blender_clasher = BlenderClasher()
48464846
blender_clasher.process_clash_set()
48474847
return {"FINISHED"}
4848+
4849+
4850+
class CleanWireframes(bpy.types.Operator):
4851+
bl_idname = "bim.clean_wireframes"
4852+
bl_label = "Clean Wireframes"
4853+
4854+
def execute(self, context):
4855+
objects = bpy.data.objects
4856+
if bpy.context.selected_objects:
4857+
objects = bpy.context.selected_objects
4858+
for obj in objects:
4859+
if not isinstance(obj.data, bpy.types.Mesh):
4860+
continue
4861+
# TODO: probably breaks i18n
4862+
if not obj.modifiers.get("EdgeSplit"):
4863+
obj.modifiers.new("EdgeSplit", "EDGE_SPLIT")
4864+
return {"FINISHED"}

src/ifcblenderexport/blenderbim/bim/ui.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2303,6 +2303,9 @@ class BIM_PT_annotation_utilities(Panel):
23032303
def draw(self, context):
23042304
layout = self.layout
23052305

2306+
row = layout.row(align=True)
2307+
row.operator("bim.clean_wireframes")
2308+
23062309
row = layout.row(align=True)
23072310
op = row.operator("bim.add_annotation", text="Dim", icon="ARROW_LEFTRIGHT")
23082311
op.obj_name = "Dimension"

0 commit comments

Comments
 (0)