Fix re-entrant calls in some cases of mesh_evaluated generation.

`mesh_get_eval_final` and friends could call `mesh_build_data`, which in
paint/sculpt mode would call `BKE_sculpt_update_mesh_elements` which
would call `mesh_get_eval_final`... ugly!
This commit is contained in:
Bastien Montagne
2018-06-19 19:00:25 +02:00
parent 85f717fcda
commit db0563e995

View File

@@ -3017,8 +3017,9 @@ static void mesh_build_data(
if ((ob->mode & OB_MODE_ALL_SCULPT) && ob->sculpt) {
/* create PBVH immediately (would be created on the fly too,
* but this avoids waiting on first stroke) */
BKE_sculpt_update_mesh_elements(depsgraph, scene, scene->toolsettings->sculpt, ob, false, false);
/* XXX Disabled for now.
* This can create horrible nasty bugs by generating re-entrant call of mesh_get_eval_final! */
// BKE_sculpt_update_mesh_elements(depsgraph, scene, scene->toolsettings->sculpt, ob, false, false);
}
BLI_assert(!(ob->derivedFinal->dirty & DM_DIRTY_NORMALS));