Fix #111698: Sculpt draws unchanged normals on first stroke

When entering sculpt mode, the normals cache is shared with the
evaluated mesh. `SharedCache::ensure()` un-shares the cache in order
to update it, so the pointers in the pbvh must be reset.
This commit is contained in:
Hans Goudey
2023-09-01 11:29:11 -04:00
parent 7e33c405fb
commit 2a28112bb8

View File

@@ -1351,6 +1351,10 @@ static void pbvh_faces_update_normals(PBVH *pbvh, Span<PBVHNode *> nodes, Mesh &
}
});
});
/* #SharedCache::update() reallocates the cached vectors if they were shared initially. */
pbvh->face_normals = mesh.runtime->face_normals_cache.data();
pbvh->vert_normals = mesh.runtime->vert_normals_cache.data();
}
static void node_update_mask_redraw(PBVH &pbvh, PBVHNode &node)