Sculpt: Fix T102209: Multiresolution levels greater than 6 crashes
pbvh->leaf_limit needs to be at least 4 to split nodes original face boundaries properly.
This commit is contained in:
parent
cad11f3098
commit
b2000412f2
Notes:
blender-bot
2024-04-29 13:07:32 +02:00
Referenced by issue #102209, Regression: Blender crashes in Sculpt Mode when subdividing with the Multiresmodifier to level 7
|
@ -833,7 +833,12 @@ void BKE_pbvh_build_grids(PBVH *pbvh,
|
|||
pbvh->gridkey = *key;
|
||||
pbvh->grid_hidden = grid_hidden;
|
||||
pbvh->subdiv_ccg = subdiv_ccg;
|
||||
pbvh->leaf_limit = max_ii(LEAF_LIMIT / (gridsize * gridsize), 1);
|
||||
|
||||
/* Ensure leaf limit is at least 4 so there's room
|
||||
* to split at original face boundaries.
|
||||
* Fixes T102209.
|
||||
*/
|
||||
pbvh->leaf_limit = max_ii(LEAF_LIMIT / (gridsize * gridsize), 4);
|
||||
|
||||
/* We need the base mesh attribute layout for PBVH draw. */
|
||||
pbvh->vdata = &me->vdata;
|
||||
|
|
Loading…
Reference in New Issue