32 const int subdiv_vertex_index)
35 const float *coordinate = reshape_vertcos_context->
vert_coords[subdiv_vertex_index];
46 const int subdiv_vertex_index)
56 const MPoly *base_poly = &base_mesh->
mpoly[face_index];
57 const int num_corners = base_poly->
totloop;
61 if (grid_coord.
u == 0.0f && grid_coord.
v == 0.0f) {
62 for (
int current_corner = 0; current_corner < num_corners; ++current_corner) {
64 corner_grid_coord.
grid_index = start_grid_index + current_corner;
66 foreach_context, &corner_grid_coord, subdiv_vertex_index);
72 foreach_context, &grid_coord, subdiv_vertex_index);
74 if (grid_coord.
u == 0.0f) {
76 prev_grid_coord.
grid_index = start_grid_index + ((
corner + num_corners - 1) % num_corners);
77 prev_grid_coord.
u = grid_coord.
v;
78 prev_grid_coord.
v = 0.0f;
81 foreach_context, &prev_grid_coord, subdiv_vertex_index);
84 if (grid_coord.
v == 0.0f) {
86 next_grid_coord.
grid_index = start_grid_index + ((
corner + 1) % num_corners);
87 next_grid_coord.
u = 0.0f;
88 next_grid_coord.
v = grid_coord.
u;
91 foreach_context, &next_grid_coord, subdiv_vertex_index);
98 const int num_vertices,
99 const int UNUSED(num_edges),
100 const int UNUSED(num_loops),
101 const int UNUSED(num_polygons),
102 const int *
UNUSED(subdiv_polygon_offset))
115 const int ptex_face_index,
116 const float ptex_face_u,
117 const float ptex_face_v,
118 const int UNUSED(coarse_face_index),
119 const int UNUSED(coarse_face_corner),
120 const int subdiv_vertex_index)
134 const int ptex_face_index,
135 const float ptex_face_u,
136 const float ptex_face_v,
137 const int UNUSED(coarse_vertex_index),
138 const int UNUSED(coarse_face_index),
139 const int UNUSED(coarse_face_corner),
140 const int subdiv_vertex_index)
154 const int ptex_face_index,
155 const float ptex_face_u,
156 const float ptex_face_v,
157 const int UNUSED(coarse_edge_index),
158 const int UNUSED(coarse_face_index),
159 const int UNUSED(coarse_face_corner),
160 const int subdiv_vertex_index)
172 const float (*vert_coords)[3],
173 const int num_vert_coords)
177 .vert_coords = vert_coords,
178 .num_vert_coords = num_vert_coords,
186 .user_data = &reshape_vertcos_context,
194 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)
bool multires_reshape_assign_final_coords_from_vertcos(const MultiresReshapeContext *reshape_context, const float(*vert_coords)[3], const int num_vert_coords)
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), const int *UNUSED(subdiv_polygon_offset))
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