Skip to content

Commit

Permalink
feat: enhance profile extrusion and solidification predictions in the…
Browse files Browse the repository at this point in the history
… Fast menu
  • Loading branch information
tristan-hm committed Jun 24, 2022
1 parent 499d96a commit 539f413
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions interface/fast_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ def draw_single_object_predictions(self, context):
self.faces = [face for face in bm.faces]
self.sketch = len(self.faces) >= 1 and is_planar(bm)
self.profile = len(self.faces) == 0 and len(self.edges) > 0
self.form = len(self.faces) > 1
self.has_faces = len(self.faces) >= 1
self.manifold = all([len(edge.link_faces) == 2 for edge in self.edges])
self.has_loose_edges = any([len(edge.link_faces) == 0 for edge in self.edges])

bm.free()

Expand Down Expand Up @@ -186,12 +187,13 @@ def draw_single_object_predictions(self, context):
layout.operator("nd.cycle", icon=icons['nd.cycle'])
layout.separator()

if not self.manifold or has_mod_solidify:
if (not self.manifold and self.has_faces) or has_mod_solidify:
layout.operator("nd.solidify", icon=icons['nd.solidify'])
has_mod_solidify = True

if has_mod_profile_extrude:
if (not self.manifold and self.has_loose_edges) or has_mod_profile_extrude:
layout.operator("nd.profile_extrude", icon=icons['nd.profile_extrude'])
has_mod_profile_extrude = True

if has_mod_screw:
layout.operator("nd.screw", icon=icons['nd.screw'])
Expand Down Expand Up @@ -226,7 +228,7 @@ def draw_single_object_predictions(self, context):

return

if self.form:
if self.has_faces:
layout.separator()
layout.operator("nd.bevel", icon=icons['nd.bevel'])
layout.operator("nd.weighted_normal_bevel", icon=icons['nd.weighted_normal_bevel'])
Expand Down

0 comments on commit 539f413

Please sign in to comment.