Fix T66312: Undo does not restore normals correctly in sculpt mode

Reviewed By: brecht

Maniphest Tasks: T66312

Differential Revision: https://developer.blender.org/D5895
This commit is contained in:
Pablo Dobarro 2019-09-25 17:02:07 +02:00
parent 6db6267d85
commit ae7bea265d
Notes: blender-bot 2023-02-14 02:22:07 +01:00
Referenced by issue #66312, Undo don't restor proper geometry in sculpt mode
1 changed files with 6 additions and 9 deletions

View File

@ -192,24 +192,21 @@ static bool sculpt_undo_restore_coords(bContext *C, Depsgraph *depsgraph, Sculpt
if (unode->orig_co) {
if (ss->modifiers_active) {
for (int i = 0; i < unode->totvert; i++) {
if (sculpt_undo_restore_deformed(ss, unode, i, index[i], mvert[index[i]].co)) {
mvert[index[i]].flag |= ME_VERT_PBVH_UPDATE;
}
sculpt_undo_restore_deformed(ss, unode, i, index[i], mvert[index[i]].co);
mvert[index[i]].flag |= ME_VERT_PBVH_UPDATE;
}
}
else {
for (int i = 0; i < unode->totvert; i++) {
if (test_swap_v3_v3(mvert[index[i]].co, unode->orig_co[i])) {
mvert[index[i]].flag |= ME_VERT_PBVH_UPDATE;
}
swap_v3_v3(mvert[index[i]].co, unode->orig_co[i]);
mvert[index[i]].flag |= ME_VERT_PBVH_UPDATE;
}
}
}
else {
for (int i = 0; i < unode->totvert; i++) {
if (test_swap_v3_v3(mvert[index[i]].co, unode->co[i])) {
mvert[index[i]].flag |= ME_VERT_PBVH_UPDATE;
}
swap_v3_v3(mvert[index[i]].co, unode->co[i]);
mvert[index[i]].flag |= ME_VERT_PBVH_UPDATE;
}
}
}