Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mesh_iterators.c
| Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | else { | ||||
| 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 */ | ||||
| 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 25 Lines | if (index) { | ||||
| 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 { | ||||
| for (int i = 0; i < mesh->totedge; i++, med++) { | for (int i = 0; i < MIN2(mesh->totedge, tot_edges); 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 */ | ||||
| void BKE_mesh_foreach_mapped_loop(Mesh *mesh, | void BKE_mesh_foreach_mapped_loop(Mesh *mesh, | ||||
| ▲ Show 20 Lines • Show All 237 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 ; )