diff options
author | Pablo Dobarro <pablodp606> | 2020-10-01 20:22:10 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-10-01 20:24:12 +0300 |
commit | b6f15d5d47bfdc1b24d5b17e46bac280d8b9a63d (patch) | |
tree | 554a5c8ca1a3540f25693d4a2e084f5f3a1cb207 /source/blender/editors/sculpt_paint | |
parent | e41437b16e6deda9fdc23ffd4baeaf912dc7052f (diff) |
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
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 9 |
1 files changed, 9 insertions, 0 deletions
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); } |