diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-12-27 15:05:49 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-12-27 15:05:49 +0400 |
commit | 76b562237f31a804cd2eba9e3af6effa54f31b5b (patch) | |
tree | d789e373995ad0ab4ca0fb5668937c5b7814bb2d /source/blender/bmesh/intern/bmesh_queries.c | |
parent | 03e388127034c35c82ed0f84b2239125111db5a4 (diff) | |
parent | d09a8ea9e7a8ad208326b99a0631e9efc7119fbd (diff) |
Merge branch 'master' into soc-2013-depsgraph_mtsoc-2013-depsgraph_mt
Conflicts:
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/shrinkwrap.c
source/blender/collada/AnimationExporter.cpp
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/makesrna/intern/rna_scene.c
source/blender/modifiers/intern/MOD_util.c
source/blender/render/intern/source/pipeline.c
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_queries.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_queries.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c index 16785778883..968ca5f3102 100644 --- a/source/blender/bmesh/intern/bmesh_queries.c +++ b/source/blender/bmesh/intern/bmesh_queries.c @@ -182,6 +182,37 @@ BMLoop *BM_loop_other_vert_loop(BMLoop *l, BMVert *v) } /** + * Given 2 verts, find the smallest face they share and give back both loops. + */ +BMFace *BM_vert_pair_share_face(BMVert *v_a, BMVert *v_b, + BMLoop **r_l_a, BMLoop **r_l_b) +{ + BMLoop *l_cur_a = NULL, *l_cur_b = NULL; + BMFace *f_cur = NULL; + + 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) { + if ((f_cur == NULL) || (l_a->f->len < f_cur->len)) { + l_b = BM_face_vert_share_loop(l_a->f, v_b); + if (l_b) { + f_cur = l_a->f; + l_cur_a = l_a; + l_cur_b = l_b; + } + } + } + } + + if (r_l_a) *r_l_a = l_cur_a; + if (r_l_b) *r_l_b = l_cur_b; + + return f_cur; +} + +/** * Get the first loop of a vert. Uses the same initialization code for the first loop of the * iterator API */ |