Page MenuHome

Sculpt: Standardize face set undo steps, optimize memory usage
ClosedPublic

Authored by Joseph Eagar (joeedh) on Oct 11 2022, 10:56 PM.

Details

Summary

Currently the face set of every single face is saved for every sculpt undo step.
When only changing the face sets of a small section of the mesh, this can be quite
wasteful. It also makes face sets a special case compare to all other sculpt undo step
types, which makes the whole system more complex and harder to improve.

This aims to fix T101203, though currently the patch introduces more glitches than it solves.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Oct 11 2022, 10:56 PM
Hans Goudey (HooglyBoogly) created this revision.

Use new face set iterators.

Fix multires crash.

Merge with latest master

Joe pointed out that before this patch can land we need to review and commit D16225: Sculpt face iterators.

Joe pointed out that before this patch can land we need to review and commit D16225: Sculpt face iterators.

Hey @Julien Kaspar (JulienKaspar), in case you didn't know about this, you can see this information as part of the diff in the "Stack" view:

  • Refactor BKE_pbvh_num_prims to BKE_pbvh_num_faces. Remember that "faces" in sculpt mode always refers to base mesh faces, not loop tris or grids.
  • Fix undo for box face sets.
  • Added SCULPT_face_set_set and SCULPT_face_set_get API methods.

The code looks fine to me now, just a few small comments inline.

source/blender/blenkernel/intern/pbvh.c
2141–2143

Tiny thing, but IMO this white space (new lines) isn't helpful here

source/blender/editors/sculpt_paint/sculpt.cc
3363 ↗(On Diff #57853)

What about BKE_pbvh_node_mark_update_face_sets here?

source/blender/editors/sculpt_paint/sculpt_undo.c
937–939

Unnecessary change here

1054

Unnecessary newline here

2121

Unnecessary change

This revision is now accepted and ready to land.Nov 20 2022, 6:31 PM
Joseph Eagar (joeedh) marked 4 inline comments as done.

Code cleanup.

Sync with latest master