Subdiv: Fix wrong corner passed to a callback
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 17 Jan 2019 11:55:51 +0000 (12:55 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 18 Jan 2019 11:29:53 +0000 (12:29 +0100)
source/blender/blenkernel/intern/subdiv_foreach.c

index 5c843561a4d5490fe03c2204800ba945e21f6728..7cb539c6c9e618cd5d9186f23644d8d3b754d7ea 100644 (file)
@@ -627,8 +627,8 @@ static void subdiv_foreach_edge_vertices_special_do(
                                corner,
                                subdiv_vertex_index);
                }
-               const int next_ptex_face_index =
-                       ptex_face_start_index + (corner + 1) % coarse_poly->totloop;
+               const int next_corner = (corner + 1) % coarse_poly->totloop;
+               const int next_ptex_face_index = ptex_face_start_index + next_corner;
                for (int vertex_index = 1;
                     vertex_index < num_vertices_per_ptex_edge - 1;
                     vertex_index++, subdiv_vertex_index += veretx_delta)
@@ -641,7 +641,7 @@ static void subdiv_foreach_edge_vertices_special_do(
                                0.0f, v,
                                coarse_edge_index,
                                coarse_poly_index,
-                               corner,
+                               next_corner,
                                subdiv_vertex_index);
                }
        }