Page MenuHome

Sculpt: Trimming tool
AbandonedPublic

Authored by Pablo Dobarro (pablodp606) on Apr 1 2020, 10:05 PM.
Tokens
"Love" token, awarded by DaveDeer."Like" token, awarded by BulatKR."Love" token, awarded by CikeTheBear."Love" token, awarded by Stig."Like" token, awarded by cfnjrey."100" token, awarded by Kickflipkid687."Love" token, awarded by Lexi4."Love" token, awarded by carlosmu."Love" token, awarded by pablovazquez."Like" token, awarded by VertexSupa."Burninate" token, awarded by Krayzmond."Love" token, awarded by ruthwikrao."Like" token, awarded by hitrpr."Love" token, awarded by OscarNebeAbad."Burninate" token, awarded by Woolpit."100" token, awarded by Dir-Surya."Like" token, awarded by knightknight."Love" token, awarded by xrg."Love" token, awarded by craig_jones."Love" token, awarded by brilliant_ape."Like" token, awarded by Loner."Love" token, awarded by monio."Love" token, awarded by 14AUDDIN."Burninate" token, awarded by Mauri."Love" token, awarded by kouza."The World Burns" token, awarded by Voguart."100" token, awarded by Frozen_Death_Knight."Burninate" token, awarded by DiogoX2."Love" token, awarded by RodDavis."Mountain of Wealth" token, awarded by Brandon777."Burninate" token, awarded by imad_mss.

Details

Summary

This implements Box Trim as a boolean based trimming tool in sculpt
mode. This is the intended way to remove parts of the sculpt instead of
using box mask and mask slice. It also creates new face sets for the new
faces created after the boolean operation.

The code for the tool itself can be considered (almost) ready, but it is
using the code from the boolean modifier to generate the new mesh. This
makes it slow and it has a lot of precission errors when calculating the
intersections. When the new boolean code of T67744 is ready, the tool
should work by just replacing the applyBool() function with the new one.
If the new boolean code can skip the mesh->bmesh conversion, it would be
much better.

Diff Detail

Repository
rB Blender
Branch
trimming-tool (branched from master)
Build Status
Buildable 7465
Build 7465: arc lint + arc unit

Event Timeline

Note that the code for bisect is faster & simpler then boolean, for a trim tool we would probably want to adjust the functionality so it only trims regions the line segment touches.

kouza (kouza) added a subscriber: kouza (kouza).
  • Refactor, Trim Line and Trim Lasso
Pablo Dobarro (pablodp606) retitled this revision from [WIP]Sculpt: Trimming tool to Sculpt: Trimming tool.Apr 5 2020, 11:43 PM
Pablo Dobarro (pablodp606) edited the summary of this revision. (Show Details)

I refactored the whole tool, now it should be easier to add more trimming modes in the future (polylines, regular polygons, beziers, snapping...) as it can cut any arbitrary polygon. I included box trimand lasso trim using this code.
The functions that generate the mesh for the boolean operation can also be reused in other modes if needed as they don't have any sculptspecific code.

I also included line trim using bisect and edgenet. Right now it is the only mode stable and fast enough for master. Maybe we can include the line trim tool enabled in the toolbar and leave box trim and lasso trim as experimental until the new boolean code is done.

Rather than 3 separate tools, could this be combined into one tool with three tool options?

@William Reynish (billreynish) It may require some refactor as the box mode needs to use the modal keymap and the other two don't. If this can be fixed, then yes, it should be easy to refactor and group these tools. But the current box mask and lasso mask operators are also split into two tools in the same submenu.

source/blender/editors/sculpt_paint/sculpt_trim.c
191

Only add UNLIKELY in areas where it matters. It doesn't seem to be here.

251

remove commented out code.

This will be implemented using sculpt gestures.