Page MenuHome

Sculpt: Mask expand operator
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Mon, Sep 2, 3:13 PM.

Details

Summary

This operator is a combined version of mask expand and mask by normal from the sculpt branch. It can be used to quickly isolate parts of a model based on topology or curvature.

  • Shift + A starts the operator in topology mode from the active vertex
  • Shift + Alt + A starts the operator in curvature mode from the active vertex

Auto pivot position and mask invert are on by default. When the mask filter is merged the code that smooths the final mask can be enabled.

Diff Detail

Repository
rB Blender

Event Timeline

  • Add option to keep the previous mask, fix some bugs
Brecht Van Lommel (brecht) requested changes to this revision.Fri, Sep 6, 7:28 PM
  • When starting the tool, it doesn't immediately do anything, only when you move the mouse a tiny amount. It should show something immediately to make it clear the tool was started.
  • It should be possible to cancel the modal tool with ESCKEY and RIGHTMOUSE, and confirm with RETKEY and PADENTER.
  • It would also help if this showed some text in the header or status bar, to give some indicating that a modal tool was started.
release/scripts/presets/keyconfig/keymap_data/blender_default.py
3851–3854

Add this to the Sculpt menu in the header as well, not just as a shortcut.

source/blender/editors/sculpt_paint/sculpt.c
8667–8669

int prevclick[2] = {(int)prevclik_f[0], (int)prevclik_f[1]};

8688–8692

I think the mask should be inverted from the start?

Like set everything to black at the start of the modal operator, then update the mask to be white when you drag.

Otherwise it's not obvious that you started the correct operation.

8744

Free before undo push. Not important but might as well slightly reduce memory peak.

8819

mask expand -> Mask Expand

8930

Mask expand -> Mask Expand

And similar for the properties

This revision now requires changes to proceed.Fri, Sep 6, 7:28 PM
Pablo Dobarro (pablodp606) marked 6 inline comments as done.Sat, Sep 7, 2:35 AM
Pablo Dobarro (pablodp606) updated this revision to Diff 17936.
  • Review update
Brecht Van Lommel (brecht) requested changes to this revision.Mon, Sep 9, 8:19 PM
  • Cancelling does not refresh the mask until you rotate the view.
  • Use ED workspace status_text to show something in the status bar, so it's clear a modal tool is active.
This revision now requires changes to proceed.Mon, Sep 9, 8:19 PM
  • Rebase
  • Enable mask smoothing with the mask filter
  • Add status message
  • Fix indentation
  • Fix updates

When I run ./blender --debug-memory and use this tool, after I exit I see these leaks:

prev mask len: 98312 0x7f81c9620238
BKE_pbvh_search_gather len: 256 0x7f81e915ecf8
  • Fix memory leak

Some lines were lost in a rebase

This revision is now accepted and ready to land.Tue, Sep 10, 2:24 PM
This revision was automatically updated to reflect the committed changes.