Page MenuHome

Sculpt: Separate hide status from face sets, use generic attribute
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Sep 12 2022, 11:11 PM.

Details

Summary

Whether faces are hidden and face sets are orthogonal concepts, but
currently sculpt mode stores them together in the face set array.
This means that if anything is hidden, there must be face sets,
and if there are face sets, we have to keep track of what is hidden.
In other words, it adds a bunch of redundant work and state tracking.

On the user level it's nice that face sets and hiding are consistent,
but we don't need to store them together to accomplish that.

This commit uses the ".hide_poly" attribute from rB2480b55f216c to
read and change hiding in sculpt mode. Face sets don't need to be
negative anymore, and a bunch of "face set <-> hide status" conversion
can be removed. Plus some other benefits:

  • We don't need to allocate either array quite as much.
  • The hide status can be read from 1/4 the memory as face sets.
  • Updates when entering or exiting sculpt mode can be removed.
  • More opportunities for early-outs when nothing is hidden.
  • Separating concerns makes sculpt code more obvious.
  • It will be easier to convert face sets into a generic int attribute.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Sep 12 2022, 11:11 PM
Hans Goudey (HooglyBoogly) created this revision.

Not really my area, but I like the simplification of the code!

Is it a no-functional-changes change from users perspective?

Hans Goudey (HooglyBoogly) edited the summary of this revision. (Show Details)
  • Merge master

Not really my area, but I like the simplification of the code!

I added you since it looked like you reviewed some of the original face set patches. Thanks for looking at it. :)

Is it a no-functional-changes change from users perspective?

Yeah, there shouldn't be any changes to functionality.

Thank for the clarification.

source/blender/blenkernel/intern/paint.cc
1956

This is neat, didn't know its possible :)

This revision is now accepted and ready to land.Sep 14 2022, 10:32 AM