Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mesh_iterators.c
| Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | else { | ||||
| for (int i = 0; i < mesh->totvert; i++, mv++) { | for (int i = 0; i < mesh->totvert; i++, mv++) { | ||||
| const short *no = (flag & MESH_FOREACH_USE_NORMAL) ? mv->no : NULL; | const short *no = (flag & MESH_FOREACH_USE_NORMAL) ? mv->no : NULL; | ||||
| func(userData, i, mv->co, NULL, no); | func(userData, i, mv->co, NULL, no); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Copied from cdDM_foreachMappedEdge */ | /** | ||||
| * Copied from #cdDM_foreachMappedEdge. | |||||
| * \param tot_edges: Number of original edges. Used to avoid calling the callback with invalid | |||||
| * edge indices. | |||||
| */ | |||||
| void BKE_mesh_foreach_mapped_edge( | void BKE_mesh_foreach_mapped_edge( | ||||
HooglyBoogly: Suggest adding a comment here. Something like this maybe:
`\param tot_edges: An override for… | |||||
| Mesh *mesh, | Mesh *mesh, | ||||
| const int tot_edges, | |||||
| void (*func)(void *userData, int index, const float v0co[3], const float v1co[3]), | void (*func)(void *userData, int index, const float v0co[3], const float v1co[3]), | ||||
| void *userData) | void *userData) | ||||
| { | { | ||||
| if (mesh->edit_mesh != NULL) { | if (mesh->edit_mesh != NULL) { | ||||
| BMEditMesh *em = mesh->edit_mesh; | BMEditMesh *em = mesh->edit_mesh; | ||||
| BMesh *bm = em->bm; | BMesh *bm = em->bm; | ||||
| BMIter iter; | BMIter iter; | ||||
| BMEdge *eed; | BMEdge *eed; | ||||
| Show All 24 Lines | if (index) { | ||||
| for (int i = 0; i < mesh->totedge; i++, med++) { | for (int i = 0; i < mesh->totedge; i++, med++) { | ||||
| const int orig = *index++; | const int orig = *index++; | ||||
| if (orig == ORIGINDEX_NONE) { | if (orig == ORIGINDEX_NONE) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| func(userData, orig, mv[med->v1].co, mv[med->v2].co); | func(userData, orig, mv[med->v1].co, mv[med->v2].co); | ||||
| } | } | ||||
| } | } | ||||
| else { | else if (mesh->totedge == tot_edges) { | ||||
| for (int i = 0; i < mesh->totedge; i++, med++) { | for (int i = 0; i < mesh->totedge; i++, med++) { | ||||
| func(userData, i, mv[med->v1].co, mv[med->v2].co); | func(userData, i, mv[med->v1].co, mv[med->v2].co); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Copied from cdDM_foreachMappedLoop */ | /* Copied from cdDM_foreachMappedLoop */ | ||||
| ▲ Show 20 Lines • Show All 238 Lines • Show Last 20 Lines | |||||
Suggest adding a comment here. Something like this maybe:
\param tot_edges: An override for the number of edges to compare, to avoid calling the callback when there isn't an evaluated edge for every original edge.
(Hopefully I understood the purpose correctly ; )