From cdbb61704d7edb9e67452b848b1eebcb3f4b0ae7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 7 Apr 2020 17:43:27 +1000 Subject: Fix T75128: Select Linked fails when the selection is a delimiter Starting select linked failed when the selected vertex or edge was it's self delimiting. Support using these elements for linked select as long as they're part of an isolated selection. --- source/blender/bmesh/intern/bmesh_query.c | 16 ++++++++++++++++ source/blender/bmesh/intern/bmesh_query.h | 2 ++ 2 files changed, 18 insertions(+) (limited to 'source/blender/bmesh/intern') diff --git a/source/blender/bmesh/intern/bmesh_query.c b/source/blender/bmesh/intern/bmesh_query.c index e3b6e243906..64950411fed 100644 --- a/source/blender/bmesh/intern/bmesh_query.c +++ b/source/blender/bmesh/intern/bmesh_query.c @@ -2431,6 +2431,22 @@ bool BM_edge_is_all_face_flag_test(const BMEdge *e, const char hflag, const bool return true; } +bool BM_edge_is_any_face_flag_test(const BMEdge *e, const char hflag) +{ + if (e->l) { + BMLoop *l_iter, *l_first; + + l_iter = l_first = e->l; + do { + if (BM_elem_flag_test(l_iter->f, hflag)) { + return true; + } + } while ((l_iter = l_iter->radial_next) != l_first); + } + + return false; +} + /* convenience functions for checking flags */ bool BM_edge_is_any_vert_flag_test(const BMEdge *e, const char hflag) { diff --git a/source/blender/bmesh/intern/bmesh_query.h b/source/blender/bmesh/intern/bmesh_query.h index fb646b11076..aaf8191c5db 100644 --- a/source/blender/bmesh/intern/bmesh_query.h +++ b/source/blender/bmesh/intern/bmesh_query.h @@ -226,6 +226,8 @@ bool BM_edge_is_all_face_flag_test(const BMEdge *e, bool BM_edge_is_any_vert_flag_test(const BMEdge *e, const char hflag) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +bool BM_edge_is_any_face_flag_test(const BMEdge *e, const char hflag) ATTR_WARN_UNUSED_RESULT + ATTR_NONNULL(); bool BM_face_is_any_vert_flag_test(const BMFace *f, const char hflag) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); bool BM_face_is_any_edge_flag_test(const BMFace *f, const char hflag) ATTR_WARN_UNUSED_RESULT -- cgit v1.2.3