mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 11:20:21 +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.SetBlenderClashSetA,
|
||||||
operator.SetBlenderClashSetB,
|
operator.SetBlenderClashSetB,
|
||||||
operator.ExecuteBlenderClash,
|
operator.ExecuteBlenderClash,
|
||||||
|
operator.CleanWireframes,
|
||||||
prop.StrProperty,
|
prop.StrProperty,
|
||||||
prop.Attribute,
|
prop.Attribute,
|
||||||
prop.MaterialLayer,
|
prop.MaterialLayer,
|
||||||
|
|||||||
@@ -4845,3 +4845,20 @@ class ExecuteBlenderClash(bpy.types.Operator):
|
|||||||
blender_clasher = BlenderClasher()
|
blender_clasher = BlenderClasher()
|
||||||
blender_clasher.process_clash_set()
|
blender_clasher.process_clash_set()
|
||||||
return {"FINISHED"}
|
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):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
|
row = layout.row(align=True)
|
||||||
|
row.operator("bim.clean_wireframes")
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
op = row.operator("bim.add_annotation", text="Dim", icon="ARROW_LEFTRIGHT")
|
op = row.operator("bim.add_annotation", text="Dim", icon="ARROW_LEFTRIGHT")
|
||||||
op.obj_name = "Dimension"
|
op.obj_name = "Dimension"
|
||||||
|
|||||||
Reference in New Issue
Block a user