mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
New clean wireframes operator to easily apply edge split modifier to nicer drawings
This commit is contained in:
@@ -230,6 +230,7 @@ if bpy is not None:
|
||||
operator.SetBlenderClashSetA,
|
||||
operator.SetBlenderClashSetB,
|
||||
operator.ExecuteBlenderClash,
|
||||
operator.CleanWireframes,
|
||||
prop.StrProperty,
|
||||
prop.Attribute,
|
||||
prop.MaterialLayer,
|
||||
|
||||
@@ -4845,3 +4845,20 @@ class ExecuteBlenderClash(bpy.types.Operator):
|
||||
blender_clasher = BlenderClasher()
|
||||
blender_clasher.process_clash_set()
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class CleanWireframes(bpy.types.Operator):
|
||||
bl_idname = "bim.clean_wireframes"
|
||||
bl_label = "Clean Wireframes"
|
||||
|
||||
def execute(self, context):
|
||||
objects = bpy.data.objects
|
||||
if bpy.context.selected_objects:
|
||||
objects = bpy.context.selected_objects
|
||||
for obj in objects:
|
||||
if not isinstance(obj.data, bpy.types.Mesh):
|
||||
continue
|
||||
# TODO: probably breaks i18n
|
||||
if not obj.modifiers.get("EdgeSplit"):
|
||||
obj.modifiers.new("EdgeSplit", "EDGE_SPLIT")
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -2303,6 +2303,9 @@ class BIM_PT_annotation_utilities(Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.operator("bim.clean_wireframes")
|
||||
|
||||
row = layout.row(align=True)
|
||||
op = row.operator("bim.add_annotation", text="Dim", icon="ARROW_LEFTRIGHT")
|
||||
op.obj_name = "Dimension"
|
||||
|
||||
Reference in New Issue
Block a user