Page MenuHome

Sculpt: Update only modified grids on multires undo
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Sat, Oct 5, 3:41 PM.
Tags
None
Tokens
"Love" token, awarded by brilliant_ape."Love" token, awarded by tiagoffcruz."Love" token, awarded by johnsyed."100" token, awarded by Frozen_Death_Knight.

Details

Summary

This makes multires undo much faster and fixes the viewport lag after and undo operation.

Diff Detail

Repository
rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Sat, Oct 5, 10:47 PM
Brecht Van Lommel (brecht) added inline comments.
source/blender/editors/sculpt_paint/sculpt_undo.c
103–110

This is a loop with O(n^2) time complexity which can get really bad when doing e.g. mesh filter on multires with a high poly base mesh. 10k grids can lead to ~100 million iterations, and it gets words as the number of grids grows.

Instead create a char array that says for a given grid index if the grid was updated or not, and then do a lookup with c_grid_index into it.

This revision now requires changes to proceed.Sat, Oct 5, 10:47 PM
Pablo Dobarro (pablodp606) marked an inline comment as done.
  • Review update
This revision is now accepted and ready to land.Sat, Oct 5, 11:24 PM