Sculpt: Reset automask cache on non-color non-mask undo steps

This commit is contained in:
Joseph Eagar 2022-09-29 02:33:24 -07:00
parent f1990bd900
commit 1494a22a90
1 changed files with 9 additions and 0 deletions

View File

@ -740,8 +740,13 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase
bool update = false, rebuild = false, update_mask = false, update_visibility = false;
bool need_mask = false;
bool need_refine_subdiv = false;
bool clear_automask_cache = false;
for (unode = lb->first; unode; unode = unode->next) {
if (!ELEM(unode->type, SCULPT_UNDO_COLOR, SCULPT_UNDO_MASK)) {
clear_automask_cache = true;
}
/* Restore pivot. */
copy_v3_v3(ss->pivot_pos, unode->pivot_pos);
copy_v3_v3(ss->pivot_rot, unode->pivot_rot);
@ -755,6 +760,10 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase
}
}
if (clear_automask_cache) {
ss->last_automasking_settings_hash = 0;
}
DEG_id_tag_update(&ob->id, ID_RECALC_SHADING);
if (lb->first) {