Page MenuHome

Sculpt: Ensure that persistent base always exist for strokes
Needs RevisionPublic

Authored by Pablo Dobarro (pablodp606) on Nov 21 2020, 4:17 PM.

Details

Summary

This creates a new persistent base if it does not exists when a new
stroke starts. This way, the "Use persistent" option of cloth and layer
brushes will work by default without expeting the user to store a
persistent base manually. Users will still store a persistent base at
any point by using the operator.

Diff Detail

Repository
rB Blender
Branch
ensure-persistent-base (branched from master)
Build Status
Buildable 11386
Build 11386: arc lint + arc unit

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Nov 21 2020, 4:17 PM

Great improvement! It feels like this patch really frees up my mind when sculpting cloth (no more "did I remember to press persistent base).

This revision is now accepted and ready to land.Nov 22 2020, 11:56 AM
  • Ensure persistent base only if it is going to be used
source/blender/editors/sculpt_paint/sculpt.c
7740

It seems it was possible to store persistent base in any mode before, so why is the BMESH case ignored?

source/blender/editors/sculpt_paint/sculpt.c
7740

See D9728.
Even if dyntopo is technically supported using the API to get the persistent base state, as soon as the topology changes the previously stored persistent base will be invalid. Adding this here will require generating the index tables and the persistent base again for each stroke each time the brush is switched.
Storing the persistent base properly in dyntopo should be a feature for the dyntopo improvements branch, so it is not lost after topology updates.

This revision now requires review to proceed.Dec 3 2020, 12:30 AM
Sergey Sharybin (sergey) requested changes to this revision.Dec 3 2020, 10:32 AM
Sergey Sharybin (sergey) added inline comments.
source/blender/editors/sculpt_paint/sculpt.c
7740

To me this change is more something like: implicitly press "store persistent base" button if it was not pressed prior to the stroke start.

If the dynamic topology does not work correct with persistent base, it should be explicitly disabled with clear communication to the artist. This will include generating an unsupported warning in the "store persistent base" operator.

Having different behavior when the state was stored explicitly and implicitly is not something I find a correct thing to do.

Also, all the non-trivial logic explanation should happen as a comment in the code.

This revision now requires changes to proceed.Dec 3 2020, 10:32 AM