48 const int subdiv_vertex_index)
51 const float *coordinate = reshape_vertcos_context->
vert_coords[subdiv_vertex_index];
62 const int subdiv_vertex_index)
72 const MPoly *base_poly = &base_mesh->
mpoly[face_index];
73 const int num_corners = base_poly->
totloop;
77 if (grid_coord.
u == 0.0f && grid_coord.
v == 0.0f) {
78 for (
int current_corner = 0; current_corner < num_corners; ++current_corner) {
80 corner_grid_coord.
grid_index = start_grid_index + current_corner;
82 foreach_context, &corner_grid_coord, subdiv_vertex_index);
88 foreach_context, &grid_coord, subdiv_vertex_index);
90 if (grid_coord.
u == 0.0f) {
92 prev_grid_coord.
grid_index = start_grid_index + ((
corner + num_corners - 1) % num_corners);
93 prev_grid_coord.
u = grid_coord.
v;
94 prev_grid_coord.
v = 0.0f;
97 foreach_context, &prev_grid_coord, subdiv_vertex_index);
100 if (grid_coord.
v == 0.0f) {
102 next_grid_coord.
grid_index = start_grid_index + ((
corner + 1) % num_corners);
103 next_grid_coord.
u = 0.0f;
104 next_grid_coord.
v = grid_coord.
u;
107 foreach_context, &next_grid_coord, subdiv_vertex_index);
114 const int num_vertices,
115 const int UNUSED(num_edges),
116 const int UNUSED(num_loops),
117 const int UNUSED(num_polygons))
130 const int ptex_face_index,
131 const float ptex_face_u,
132 const float ptex_face_v,
133 const int UNUSED(coarse_face_index),
134 const int UNUSED(coarse_face_corner),
135 const int subdiv_vertex_index)
149 const int ptex_face_index,
150 const float ptex_face_u,
151 const float ptex_face_v,
152 const int UNUSED(coarse_vertex_index),
153 const int UNUSED(coarse_face_index),
154 const int UNUSED(coarse_face_corner),
155 const int subdiv_vertex_index)
169 const int ptex_face_index,
170 const float ptex_face_u,
171 const float ptex_face_v,
172 const int UNUSED(coarse_edge_index),
173 const int UNUSED(coarse_face_index),
174 const int UNUSED(coarse_face_corner),
175 const int subdiv_vertex_index)
188 const float (*vert_coords)[3],
189 const int num_vert_coords)
193 .vert_coords = vert_coords,
194 .num_vert_coords = num_vert_coords,
202 .user_data = &reshape_vertcos_context,
210 reshape_context->
subdiv, &foreach_context, &mesh_settings, reshape_context->
base_mesh);
typedef float(TangentPoint)[2]
bool BKE_subdiv_foreach_subdiv_geometry(struct Subdiv *subdiv, const struct SubdivForeachContext *context, const struct SubdivToMeshSettings *mesh_settings, const struct Mesh *coarse_mesh)
MINLINE void copy_v3_v3(float r[3], const float a[3])
int multires_reshape_grid_to_face_index(const MultiresReshapeContext *reshape_context, int grid_index)
ReshapeGridElement multires_reshape_grid_element_for_grid_coord(const MultiresReshapeContext *reshape_context, const GridCoord *grid_coord)
GridCoord multires_reshape_ptex_coord_to_grid(const MultiresReshapeContext *reshape_context, const PTexCoord *ptex_coord)
static void multires_reshape_vertcos_foreach_single_vertex(const SubdivForeachContext *foreach_context, const GridCoord *grid_coord, const int subdiv_vertex_index)
static void multires_reshape_vertcos_foreach_vertex(const SubdivForeachContext *foreach_context, const PTexCoord *ptex_coord, const int subdiv_vertex_index)
static void multires_reshape_vertcos_foreach_vertex_every_edge(const struct SubdivForeachContext *foreach_context, void *UNUSED(tls_v), const int ptex_face_index, const float ptex_face_u, const float ptex_face_v, const int UNUSED(coarse_edge_index), const int UNUSED(coarse_face_index), const int UNUSED(coarse_face_corner), const int subdiv_vertex_index)
static void multires_reshape_vertcos_foreach_vertex_every_corner(const struct SubdivForeachContext *foreach_context, void *UNUSED(tls_v), const int ptex_face_index, const float ptex_face_u, const float ptex_face_v, const int UNUSED(coarse_vertex_index), const int UNUSED(coarse_face_index), const int UNUSED(coarse_face_corner), const int subdiv_vertex_index)
static bool multires_reshape_vertcos_foreach_topology_info(const SubdivForeachContext *foreach_context, const int num_vertices, const int UNUSED(num_edges), const int UNUSED(num_loops), const int UNUSED(num_polygons))
bool multires_reshape_assign_final_coords_from_vertcos(const MultiresReshapeContext *reshape_context, const float(*vert_coords)[3], const int num_vert_coords)
static void multires_reshape_vertcos_foreach_vertex_inner(const SubdivForeachContext *foreach_context, void *UNUSED(tls_v), const int ptex_face_index, const float ptex_face_u, const float ptex_face_v, const int UNUSED(coarse_face_index), const int UNUSED(coarse_face_corner), const int subdiv_vertex_index)
struct MultiresReshapeAssignVertcosContext MultiresReshapeAssignVertcosContext
const float(* vert_coords)[3]
const int num_vert_coords
const MultiresReshapeContext * reshape_context
struct MultiresReshapeContext::@99 reshape
int * face_start_grid_index
SubdivForeachTopologyInformationCb topology_info