Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606>2020-10-01 20:22:10 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-10-01 20:24:12 +0300
commitb6f15d5d47bfdc1b24d5b17e46bac280d8b9a63d (patch)
tree554a5c8ca1a3540f25693d4a2e084f5f3a1cb207
parente41437b16e6deda9fdc23ffd4baeaf912dc7052f (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
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c9
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);
}