Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/subdiv_mesh.c
| Show First 20 Lines • Show All 1,106 Lines • ▼ Show 20 Lines | if (ctx->vert_origindex != NULL) { | ||||
| ctx->vert_origindex[subdiv_vertex_index] = ORIGINDEX_NONE; | ctx->vert_origindex[subdiv_vertex_index] = ORIGINDEX_NONE; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void subdiv_mesh_vertex_of_loose_edge(const struct SubdivForeachContext *foreach_context, | static void subdiv_mesh_vertex_of_loose_edge(const struct SubdivForeachContext *foreach_context, | ||||
| void *UNUSED(tls), | void *UNUSED(tls), | ||||
| const int coarse_edge_index, | const int coarse_edge_index, | ||||
| const int u_index, | |||||
| const float u, | const float u, | ||||
| const int subdiv_vertex_index) | const int subdiv_vertex_index) | ||||
| { | { | ||||
| SubdivMeshContext *ctx = foreach_context->user_data; | SubdivMeshContext *ctx = foreach_context->user_data; | ||||
| const Mesh *coarse_mesh = ctx->coarse_mesh; | const Mesh *coarse_mesh = ctx->coarse_mesh; | ||||
| const MEdge *coarse_edge = &coarse_mesh->medge[coarse_edge_index]; | const MEdge *coarse_edge = &coarse_mesh->medge[coarse_edge_index]; | ||||
| Mesh *subdiv_mesh = ctx->subdiv_mesh; | Mesh *subdiv_mesh = ctx->subdiv_mesh; | ||||
| MVert *subdiv_mvert = subdiv_mesh->mvert; | MVert *subdiv_mvert = subdiv_mesh->mvert; | ||||
| const bool is_simple = ctx->subdiv->settings.is_simple; | const bool is_simple = ctx->subdiv->settings.is_simple; | ||||
| /* Find neighbors of the current loose edge. */ | /* Find neighbors of the current loose edge. */ | ||||
| const MEdge *neighbors[2]; | const MEdge *neighbors[2]; | ||||
| find_edge_neighbors(ctx, coarse_edge, neighbors); | find_edge_neighbors(ctx, coarse_edge, neighbors); | ||||
| /* Interpolate custom data. */ | /* Interpolate custom data when not an end point (this data has already been initialized). */ | ||||
sergey: `Initialized` != `assigned to what it is supposed to be based on the interpolation and whatnot`. | |||||
| if (u_index != 0 && u_index != ctx->settings->resolution - 1) { | |||||
| subdiv_mesh_vertex_of_loose_edge_interpolate(ctx, coarse_edge, u, subdiv_vertex_index); | subdiv_mesh_vertex_of_loose_edge_interpolate(ctx, coarse_edge, u, subdiv_vertex_index); | ||||
| } | |||||
| /* Interpolate coordinate. */ | /* Interpolate coordinate. */ | ||||
| MVert *subdiv_vertex = &subdiv_mvert[subdiv_vertex_index]; | MVert *subdiv_vertex = &subdiv_mvert[subdiv_vertex_index]; | ||||
| if (is_simple) { | if (is_simple) { | ||||
| const MVert *coarse_mvert = coarse_mesh->mvert; | const MVert *coarse_mvert = coarse_mesh->mvert; | ||||
| const MVert *vert_1 = &coarse_mvert[coarse_edge->v1]; | const MVert *vert_1 = &coarse_mvert[coarse_edge->v1]; | ||||
| const MVert *vert_2 = &coarse_mvert[coarse_edge->v2]; | const MVert *vert_2 = &coarse_mvert[coarse_edge->v2]; | ||||
| interp_v3_v3v3(subdiv_vertex->co, vert_1->co, vert_2->co, u); | interp_v3_v3v3(subdiv_vertex->co, vert_1->co, vert_2->co, u); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines | |||||
Initialized != assigned to what it is supposed to be based on the interpolation and whatnot. The comment also doesn't mention where exactly the assignment happened.
For the endpoint which connects loose edge to the manifold it is quite clear where the interpolation happens. But it is unclear to me where interpolation of endpoint of edge which is not adjacent to the manifold happens.