Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_query.c')
-rw-r--r--source/blender/bmesh/intern/bmesh_query.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/bmesh/intern/bmesh_query.c b/source/blender/bmesh/intern/bmesh_query.c
index 51bc86e40eb..219bec15e5b 100644
--- a/source/blender/bmesh/intern/bmesh_query.c
+++ b/source/blender/bmesh/intern/bmesh_query.c
@@ -207,6 +207,34 @@ bool BM_vert_pair_share_face_check_cb(BMVert *v_a,
return false;
}
+BMFace *BM_vert_pair_shared_face_cb(BMVert *v_a,
+ BMVert *v_b,
+ const bool allow_adjacent,
+ bool (*callback)(BMFace *, BMLoop *, BMLoop *, void *userdata),
+ void *user_data,
+ BMLoop **r_l_a,
+ BMLoop **r_l_b)
+{
+ if (v_a->e && v_b->e) {
+ BMIter iter;
+ BMLoop *l_a, *l_b;
+
+ BM_ITER_ELEM (l_a, &iter, v_a, BM_LOOPS_OF_VERT) {
+ BMFace *f = l_a->f;
+ l_b = BM_face_vert_share_loop(f, v_b);
+ if (l_b && (allow_adjacent || !BM_loop_is_adjacent(l_a, l_b)) &&
+ callback(f, l_a, l_b, user_data)) {
+ *r_l_a = l_a;
+ *r_l_b = l_b;
+
+ return f;
+ }
+ }
+ }
+
+ return NULL;
+}
+
/**
* Given 2 verts, find the smallest face they share and give back both loops.
*/