From b6f15d5d47bfdc1b24d5b17e46bac280d8b9a63d Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Thu, 1 Oct 2020 19:22:10 +0200 Subject: Fix T80873: Grab active vertex preview not working with shape keys When a Shape Key is active, use the PBVH deformed coordinates for the preview. Reviewed By: sergey Maniphest Tasks: T80873 Differential Revision: https://developer.blender.org/D8921 --- source/blender/editors/sculpt_paint/sculpt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index f9dbfaa5da9..2bc19b625cd 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -206,9 +206,18 @@ const float *SCULPT_vertex_persistent_co_get(SculptSession *ss, int index) const float *SCULPT_vertex_co_for_grab_active_get(SculptSession *ss, int index) { + /* Always grab active shape key if the sculpt happens on shapekey. */ + if (ss->shapekey_active) { + const MVert *mverts = BKE_pbvh_get_verts(ss->pbvh); + return mverts[index].co; + } + + /* Sculpting on the base mesh. */ if (ss->mvert) { return ss->mvert[index].co; } + + /* Everything else, such as sculpting on multires. */ return SCULPT_vertex_co_get(ss, index); } -- cgit v1.2.3