[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55642] trunk/blender/source/blender/ editors/sculpt_paint/sculpt.c: Fix #34773: smooth brush used on a shape key messes up the topology

Sergey Sharybin sergey.vfx at gmail.com
Thu Mar 28 07:11:32 CET 2013


Revision: 55642
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55642
Author:   nazgul
Date:     2013-03-28 06:11:32 +0000 (Thu, 28 Mar 2013)
Log Message:
-----------
Fix #34773: smooth brush used on a shape key messes up the topology

Key block update was missing coordinates for hidden vertices.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/sculpt_paint/sculpt.c

Modified: trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2013-03-28 06:01:58 UTC (rev 55641)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2013-03-28 06:11:32 UTC (rev 55642)
@@ -3221,15 +3221,23 @@
 		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);
 




More information about the Bf-blender-cvs mailing list