diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-03-28 10:11:32 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-03-28 10:11:32 +0400 |
commit | ebc538c56ce6f4a1c38721e833a95ed2ac900ca5 (patch) | |
tree | 82a45345c2950a66a2e44edc9bb03e1160037693 | |
parent | 765060acd4ddacaf75641989e2edddcdbcff10fd (diff) |
Fix #34773: smooth brush used on a shape key messes up the topology
Key block update was missing coordinates for hidden vertices.
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 20b8f90df8b..5a6bc823dc0 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -3221,15 +3221,23 @@ static void sculpt_flush_stroke_deform(Sculpt *sd, Object *ob) float (*vertCos)[3] = NULL; if (ss->kb) - vertCos = MEM_callocN(sizeof(*vertCos) * me->totvert, "flushStrokeDeofrm keyVerts"); + vertCos = MEM_mallocN(sizeof(*vertCos) * me->totvert, "flushStrokeDeofrm keyVerts"); BKE_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode); #pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP) for (n = 0; n < totnode; n++) { PBVHVertexIter vd; + int mode = PBVH_ITER_UNIQUE; - BKE_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) + /* when sculpting on a shape key, we need to gather all vertices, even + * hidden one, so key block update happens correct (otherwise we'll + * miss coordinates for hidden vertices) + */ + if (ss->kb) + mode = PBVH_ITER_ALL; + + BKE_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, mode) { sculpt_flush_pbvhvert_deform(ob, &vd); |