Page MenuHome

Sculpt: Update only modified grids on multires undo
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Oct 5 2019, 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
Branch
multires-undo- (branched from master)
Build Status
Buildable 5250
Build 5250: arc lint + arc unit

Event Timeline

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

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.Oct 5 2019, 10:47 PM
Pablo Dobarro (pablodp606) marked an inline comment as done.
  • Review update
This revision is now accepted and ready to land.Oct 5 2019, 11:24 PM