You can now align the view to the edited profile, for angled profiles

This commit is contained in:
Dion Moult
2022-09-29 22:33:26 +10:00
parent a248f16cf8
commit 60e4de5ffa
3 changed files with 32 additions and 0 deletions
@@ -20,6 +20,7 @@ import bpy
from . import operator, prop, workspace
classes = (
operator.AlignViewToProfile,
operator.AddIfcArcIndexFillet,
operator.AddIfcCircle,
operator.CadArcFrom2Points,
@@ -751,3 +751,33 @@ class AddIfcArcIndexFillet(bpy.types.Operator):
bm.verts.index_update()
bm.edges.index_update()
bmesh.update_edit_mesh(obj.data)
class AlignViewToProfile(bpy.types.Operator):
bl_idname = "bim.align_view_to_profile"
bl_label = "Align View To Profile"
# __ ___
# .'. -- . '.
# /U) __ (O|
# /.' ()() '.\._
# .',/;,_.--._.;;) . '--..__
# / ,///|.__.|.\\\ \ '. '.''---..___
# /'._ '' || || '' _'\ : \ ' . '.
# / || || '., ) ) : \
# :'-.__ _ || || _ __.' _\_ .' ' ' ,)
# ( ' |' ( __= ___..-._ ( (.\\
# ('\ .___ ___. /'.___= \.\.\
# \\\-..____________..-'///
@classmethod
def poll(cls, context):
obj = context.active_object
return bool(obj) and obj.type == "MESH"
def execute(self, context):
bpy.ops.object.mode_set(mode="OBJECT")
bpy.ops.view3d.view_axis(type="TOP", align_active=True)
region_3d = bpy.context.area.spaces.active.region_3d
region_3d.view_perspective = "ORTHO"
bpy.ops.object.mode_set(mode="EDIT")
return {"FINISHED"}
@@ -51,6 +51,7 @@ class CadTool(WorkSpaceTool):
row.label(text="", icon="EVENT_SHIFT")
row.label(text="", icon="EVENT_Q")
row.operator("bim.edit_extrusion_profile", text="Save Profile")
row.operator("bim.align_view_to_profile", text="", icon="AXIS_FRONT")
row.operator("bim.disable_editing_extrusion_profile", text="", icon="CANCEL")
row = layout.row(align=True)