Fix #22487: Shrinkwrap ignores preceding deform modifiers
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 7 Jun 2010 17:38:52 +0000 (17:38 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 7 Jun 2010 17:38:52 +0000 (17:38 +0000)
ShrinkwrapCalcData->vert contains verts from derivedMesh this coordinated
are deformed by vertexCos only for normal projection (to get correct normals)
for other cases this field contains undeformed dm's coordinates and
vertexCos should be used

source/blender/blenkernel/intern/shrinkwrap.c

index 574ec848291b3e0cd5332d888b4e698209e4ff3d..bddfeb049a8584d699e240d18e47f34513bb8eeb 100644 (file)
@@ -355,11 +355,16 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, struct S
 
                        if(calc->vert)
                        {
-                               VECCOPY(tmp_co, calc->vert[i].co);
-                               if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL)
+                               /* calc->vert contains verts from derivedMesh  */
+                               /* this coordinated are deformed by vertexCos only for normal projection (to get correct normals) */
+                               /* for other cases calc->varts contains undeformed coordinates and vertexCos should be used */
+                               if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) {
+                                       VECCOPY(tmp_co, calc->vert[i].co);
                                        normal_short_to_float_v3(tmp_no, calc->vert[i].no);
-                               else
+                               } else {
+                                       VECCOPY(tmp_co, co);
                                        VECCOPY(tmp_no, proj_axis);
+                               }
                        }
                        else
                        {