Page MenuHome

Destructive Extrude Operator
Needs ReviewPublic

Authored by CandleComet (CandleComet) on Jul 24 2019, 9:18 PM.
"Like" token, awarded by yebyte."Love" token, awarded by jc4d."Love" token, awarded by iWaraxe."Love" token, awarded by n-pigeon."Like" token, awarded by YAFU."Love" token, awarded by Rusculleda."Love" token, awarded by roman13."Like" token, awarded by belich."Love" token, awarded by johnandress."Love" token, awarded by fiendish55."Love" token, awarded by maxivz."Love" token, awarded by mazigh."100" token, awarded by Frozen_Death_Knight."Love" token, awarded by bnzs."Like" token, awarded by hjrabi."Yellow Medal" token, awarded by madminstrel."Love" token, awarded by ugosantana."Burninate" token, awarded by jfmatheu."Like" token, awarded by astrand130."Like" token, awarded by johnpdelacruz26."Love" token, awarded by rl.amorato."Love" token, awarded by brilliant_ape."Love" token, awarded by JulienKaspar."Love" token, awarded by amonpaike."Love" token, awarded by jendrzych."Love" token, awarded by xrg."Love" token, awarded by TheRedWaxPolice."Love" token, awarded by Okavango."Like" token, awarded by ace_dragon."Love" token, awarded by Otilla."Love" token, awarded by HooglyBoogly."Like" token, awarded by meta-androcto."Like" token, awarded by campbellbarton.


Group Reviewers

This code adds an extrude variant which functions by first extruding normally then joining and dissolving certain geometry. The operator makes it extremely quick and simple to block out environments, complex buildings, stairs, doors, etc.

This tool has four options:

  • Original Loop determines whether to keep the original boundary edges of the extrusion.
  • Successive Loops determines whether to insert loops after contacting new geometry.
  • Destroy End determines whether to delete open faces after the extrusion, simulating a boolean hole.
  • Keep Sides keeps the faces sides of the extrusion, even when extruding in.

These options are hard to explain, try looking at the video to see exactly what I mean.
Also, there is the ability to snap to existing loops while holding ctrl.

Demonstrates the four options and some of the capabilities of the tool.

( Recordings of past versions: F7779114 F7673205 )

Design Points:

  • This operator does not use boolean. It accesses only local geometry. Disconnected and in-adjacent geometry is basically ignored. This means that it is usually impossible to create a hole by extruding 'all the way through.'
  • The operator utilizes code from automerge split edges & faces when welding itself onto an edge loop.

Diff Detail

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Nice functionality, don't have time for review now.

Seems useful for low poly modeling, users may quickly want this to perform more advanced boolean-like operation.

Added to T63731: Modeling Module to review for 2.81.


BM_edge_is_boundary can be used here.

Really nice functionality. We have this in addon form missing the ability to set depth in mesh tools addon's "Extrude and Reshape" by @Germano Cavalcante (mano-wii)
There's also an external Destructive Extrude addon with same/similar functionality. It would be great to have this built in.

  • In bmo_extrude_destructive: Used BM_edge_is_boundary rather than checking BM_edge_face_count is 1.
  • In bmesh_opdefines: Deleted 2 unused slots which had somehow slipped by.
CandleComet (CandleComet) marked an inline comment as done.

Code cleanup, renaming, simplifying.

@CandleComet (CandleComet)
What You mean by "it is usually impossible to create a hole by extruding 'all the way"? Rare, exceptional cases, or rather most of the situations?
Making holes by extruding part of a geometry all the way its volume is one of the main potential strength of this tool! Lack of it makes it less useful than it could be. Sketchup's Push'n'Pull works this way and makes modeling super fast, elegant and enjoyable.

@Andrzej Ambroz (jendrzych)
Basically, it can never create an actual hole. It only works where faces lie along the boundary. For example, in a subdivided cube:

  • extruding down a corner all the way through works
  • extruding down a face on the side also works
  • extruding a center face completely through does not create a hole. That would be very useful, though. The geometry on the bottom side is not taken into account.

This is the case because this operator isn't based on a boolean operation, I mean it does not take volumes into account. It's based more on the actual boundary topology, like regular extrude. So accessing separated faces on the other side is difficult. The benefit, however, is that this gives the ability for more topological options like Original Loop and Successive Loops.

Hello guys. I would like to propose an additional type of extrude function.

here is the link. Thanks.

Had a look at @John Paul Anthony G. Dela Cruz (johnpdelacruz26) 's idea and saw that it'd be quite simple to code.

  • Added it as an option called Keep Sides. Thanks, johnpdelacruz26

I'll update the recording soon to demonstrate this option.

Thank you. I appreciate the work.

In terms of the UI/interaction, we should make sure the Extrude gizmo works here.

Will this project be accepted for blender 2.81?
tomorrow is the last day for new features in blender 2.81

CandleComet (CandleComet) updated this revision to Diff 18235.EditedSep 15 2019, 2:13 AM
  • I moved code from bmo_extrude_destrucive into editmesh_extrude_destructive so that now it handles welding and deleting faces between recursions.
  • Between recursions, editmesh_extrude_destructive utilizes a function from auto-merge split edges & faces, so now cases like
    work as users would expect.
  • cleanup
CandleComet (CandleComet) set the repository for this revision to rB Blender.
CandleComet (CandleComet) edited the summary of this revision. (Show Details)
CandleComet (CandleComet) updated this revision to Diff 18240.EditedSep 15 2019, 3:32 PM
  • Fix a bug causing faces to become deselected between recursions.
  • That bug apparently had prevented cases like
    from working properly. So that case actually works now :)

In terms of the UI/interaction, we should make sure the Extrude gizmo works here.

I definitely agree, so I'll look into it soon. I may have to remake some of that gizmo since this operator does not use a translation operation like regular extrude.

Will this project be accepted for blender 2.81?
tomorrow is the last day for new features in blender 2.81

Probably not; it's marked as lower priority, and there's no rush. Hopefully, it will make it into 2.82.

CandleComet, thanks for your work!

Is it ok to report crashes here? Since this seems work in progress, I am not sure if it could be just because the operation I want to execute has not yet been implemented.
Here for example Destructive Extrude the selected face and move down to the next face, and there blender crash:

  • Fix crash from BM_faces_join by limiting it to two faces. @YAFU (YAFU) This should fix the crash with your blend file.
  • Fix calling recursion code unnecessarily when the depth is near 0.
  • Updated the diff to match a recent name change
Juan (jc4d) added a subscriber: Juan (jc4d).
  • Operator is now controlled by moving the mouse along the direction of the extrusion, rather than moving the mouse vertically. I'll update the recording soon to demonstrate this change.