Skip to content

Commit

Permalink
feat: add alt mode to geo_lift operator to ignore all bevels when cal…
Browse files Browse the repository at this point in the history
…culating selectable geometry
  • Loading branch information
tristan-hm committed Apr 25, 2022
1 parent 74f0d8a commit 2aff5bc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sketching/geo_lift.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
class ND_OT_geo_lift(bpy.types.Operator):
bl_idname = "nd.geo_lift"
bl_label = "Geo Lift"
bl_description = "Lift geometry out of a non-destructive object"
bl_description = """Lift geometry out of a non-destructive object
SHIFT — Ignore bevels when calculating selectable geometry"""
bl_options = {'UNDO'}


Expand Down Expand Up @@ -79,6 +80,8 @@ def modal(self, context, event):
def invoke(self, context, event):
self.selection_type = 2 # ['VERT', 'EDGE', 'FACE']
self.register_mode()

self.ignore_bevels = event.shift

self.prepare_face_selection_mode(context)

Expand Down Expand Up @@ -111,6 +114,11 @@ def set_selection_mode(self, context):
def prepare_face_selection_mode(self, context):
bpy.ops.object.duplicate()

if self.ignore_bevels:
mods = [mod.name for mod in context.object.modifiers if mod.type == 'BEVEL' and mod.affect == 'EDGES']
for mod in mods:
bpy.ops.object.modifier_remove(modifier=mod)

depsgraph = context.evaluated_depsgraph_get()
object_eval = context.object.evaluated_get(depsgraph)

Expand Down

0 comments on commit 2aff5bc

Please sign in to comment.