diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-07-10 05:55:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-07-10 06:01:46 +0300 |
commit | 89cb41faa0596d898f850f68c46e2b39c25e6452 (patch) | |
tree | bda8a19c7b819cbdf6b17cba62a62f67efe79985 /source/blender/editors | |
parent | 3fdd092649c038550776970ee7ded56afc3e94ab (diff) |
UV: allow ripping face-regions
This changes the behavior of rip when entire faces are selected.
Now face regions are isolated and moved instead of ripping the edge-loop
extracted from the selection boundary.
This is a convenient alternative to separate selection & move.
Resolves T78751.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_rip.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/source/blender/editors/uvedit/uvedit_rip.c b/source/blender/editors/uvedit/uvedit_rip.c index 934c2e0457f..66903e3eefa 100644 --- a/source/blender/editors/uvedit/uvedit_rip.c +++ b/source/blender/editors/uvedit/uvedit_rip.c @@ -812,26 +812,25 @@ static bool uv_rip_object(Scene *scene, Object *obedit, const float co[2], const } } - /* Mark only boundary edges. */ + /* Special case: if we have selected faces, isolated them. + * This isn't a rip, however it's useful for users as a quick way + * to detech the selection. + * + * We could also extract an edge loop from the boundary + * however in practice it's not that useful, see T78751. */ if (is_select_all_any) { BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { - if (BM_elem_flag_test(efa, BM_ELEM_TAG)) { - BMLoop *l_first = BM_FACE_FIRST_LOOP(efa); - if (UL(l_first)->is_select_all) { - BMLoop *l_iter = l_first; - do { - BMLoop *l_other = bm_loop_find_other_radial_loop_with_visible_face(l_iter, - cd_loop_uv_offset); - if (l_other != NULL) { - if (UL(l_other)->is_select_all) { - UL(l_iter)->is_select_edge = false; - UL(l_other)->is_select_edge = false; - } - } - } while ((l_iter = l_iter->next) != l_first); + BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { + if (!UL(l)->is_select_all) { + MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); + if (luv->flag & MLOOPUV_VERTSEL) { + luv->flag &= ~MLOOPUV_VERTSEL; + changed = true; + } } } } + return changed; } /* Extract loop pairs or single loops. */ |