Page MenuHome

Fix T96810: Invalid sculpt normals after some operations
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Jul 30 2022, 5:33 AM.

Details

Summary

Mask and color brushes were using the existing PBVH vertex "update tag"
to mark their modifications. This was mostly unnecessary, and causes
unnecessary calculation of normals. I also caused errors though,
because they didn't tag the corresponding PBVH node for normal
recalculation. This caused errors on the borders of nodes, since
one node might accumulate into another's vertex normals, but the
other node wouldn't also accumulate and normalize the normals.

The solution is to only use the update tag for tagging deformed
vertices that need recalculated normals. Everything else is handled at
the PBVH node level (which was already the case, but it wasn't clear).
I renamed functions to make that clear.

The update tag was also used in sculpt undo to tag the nodes
corresponding to changed vertices. This was wrong though, because
normals and visibility would also be recalculated for just color
or mask undo steps. Instead, just use local arrays to keep track of
modified elements for tagging nodes.

Diff Detail

Repository
rB Blender