Page MenuHome

Face Set Edit: Delete Geometry operation
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Sep 18 2020, 3:34 AM.
Tags
None
Tokens
"Love" token, awarded by Blender_Defender."100" token, awarded by Regnas."100" token, awarded by Torrent."Burninate" token, awarded by NAS."100" token, awarded by Frozen_Death_Knight.

Details

Summary

This adds an operation mode to the Face Set Edit tool which deletes the
geometry of a Face Set by clicking on it.
The operator also checks for the mesh having a single Face Set to avoid
deleting the entire object by accident.
This is also disabled for Multires to avoid modifying the limit surface
without control (it is not an important limitation as base meshes for
multires are usually final, but maybe it can be supported in the future).

Diff Detail

Repository
rB Blender

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Sep 18 2020, 3:34 AM
Pablo Dobarro (pablodp606) created this revision.

This seems to work fine. I like that it's disabled when no face sets are used or when sculpting on multires subdivisions.

At some point there should be discussion on how many modes are planned and should be added to this tool and how the UI/UX can be changed to make using it more effortless.

source/blender/editors/sculpt_paint/sculpt_face_set.c
1145

Reduce vertical size, BMesh *bm = ...

1291–1315

All this feels to belong to two separate function, one of which handles geometry case, another one which handles visibility case. Interleaving them together is confusing.

Pablo Dobarro (pablodp606) marked 2 inline comments as done.
  • review update
Sergey Sharybin (sergey) added inline comments.
source/blender/editors/sculpt_paint/sculpt_face_set.c
1294–1297

I don't understand this. You shouldn't be checking for events in the invoke.

1310–1312

You should be able to

const float mouse[2] = {event->mval[0], event->mval[1]};

@Julian Eisel (Severin), is it how we handle other operators where we need them to be called from mouse events?

Pablo Dobarro (pablodp606) marked 2 inline comments as done.
  • review update
source/blender/editors/sculpt_paint/sculpt_face_set.c
1107

check_single_face_set is something what checks the state of the mesh regardless of the operation. Hence, having an argument modify_hidden is confusing and misleading:

  • The function foes not modify anything
  • It is not clear how this affects on the check process itself (without reading the code, which is still quite cryptic).

For good API it will be clear what function does from its name and argument list.

1210
1216–1217

I do not quite follow the explanation. My interpretation:

/* Modification of base mesh geometry requires special remapping of multires displacement, which does not happen here.
 * Disable delete operation. It can be supported in the future by
 * by doing similar displacement data remapping as what happens in the mesh edit mode. */
Pablo Dobarro (pablodp606) marked 3 inline comments as done.
  • Review update
This revision is now accepted and ready to land.Oct 23 2020, 12:36 PM
source/blender/editors/sculpt_paint/sculpt_face_set.c
1310–1312

Doing it like this is fine. Although I'd prefer it to be const (it's not in the current patch). Why make int active_face_set const but not an immutable array that's also a reference? :)