From 1ebb6e3360587fa673666a957538c8280b646f3c Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Tue, 28 Feb 2012 23:08:40 +0000 Subject: Code cleanup for the neighbor_average() sculpt function. Moved some of the code into a couple new mesh functions for searching in poly loops to simplify the function, the rest is just cosmetic changes. --- source/blender/blenkernel/BKE_mesh.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/blenkernel/BKE_mesh.h') diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 016cef60dcc..e06dee2704e 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -99,6 +99,18 @@ void mesh_calc_poly_center(struct MPoly *mpoly, struct MLoop *loopstart, float mesh_calc_poly_area(struct MPoly *mpoly, struct MLoop *loopstart, struct MVert *mvarray, float polynormal[3]); +/* Find the index of the loop in 'poly' which references vertex, + returns -1 if not found */ +int poly_find_loop_from_vert(const struct MPoly *poly, + const struct MLoop *loopstart, + unsigned vert); + +/* Fill 'adj_r' with the loop indices in 'poly' adjacent to the + vertex. Returns the index of the loop matching vertex, or -1 if the + vertex is not in 'poly' */ +int poly_get_adj_loops_from_vert(unsigned adj_r[3], const struct MPoly *poly, + const struct MLoop *mloop, unsigned vert); + void unlink_mesh(struct Mesh *me); void free_mesh(struct Mesh *me, int unlink); struct Mesh *add_mesh(const char *name); -- cgit v1.2.3