diff options
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_rip.c')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_rip.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/source/blender/editors/uvedit/uvedit_rip.c b/source/blender/editors/uvedit/uvedit_rip.c index 272540d61c7..545cc57e3c4 100644 --- a/source/blender/editors/uvedit/uvedit_rip.c +++ b/source/blender/editors/uvedit/uvedit_rip.c @@ -52,7 +52,7 @@ /** Unordered loop data, stored in #BMLoop.head.index. */ typedef struct ULData { - /** When this UV is selected as well as the next UV. */ + /** When the specified UV edge is selected. */ uint is_select_edge : 1; /** * When only this UV is selected and none of the other UV's @@ -762,15 +762,17 @@ static bool uv_rip_object(Scene *scene, Object *obedit, const float co[2], const const MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); if (luv->flag & MLOOPUV_VERTSEL) { const MLoopUV *luv_prev = BM_ELEM_CD_GET_VOID_P(l->prev, cd_loop_uv_offset); - const MLoopUV *luv_next = BM_ELEM_CD_GET_VOID_P(l->next, cd_loop_uv_offset); - if (luv_next->flag & MLOOPUV_VERTSEL) { + if (luv->flag & MLOOPUV_EDGESEL) { UL(l)->is_select_edge = true; } + else if ((luv_prev->flag & MLOOPUV_EDGESEL) == 0) { + /* #bm_loop_uv_select_single_vert_validate validates below. */ + UL(l)->is_select_vert_single = true; + is_all = false; + } else { - if ((luv_prev->flag & MLOOPUV_VERTSEL) == 0) { - /* #bm_loop_uv_select_single_vert_validate validates below. */ - UL(l)->is_select_vert_single = true; - } + /* Cases where all vertices of a face are selected but not all edges are selected. */ + is_all = false; } } else { @@ -797,7 +799,7 @@ static bool uv_rip_object(Scene *scene, Object *obedit, const float co[2], const } } - /* Special case: if we have selected faces, isolated them. + /* Special case: if we have selected faces, isolate them. * This isn't a rip, however it's useful for users as a quick way * to detach the selection. * @@ -812,6 +814,10 @@ static bool uv_rip_object(Scene *scene, Object *obedit, const float co[2], const luv->flag &= ~MLOOPUV_VERTSEL; changed = true; } + if (luv->flag & MLOOPUV_EDGESEL) { + luv->flag &= ~MLOOPUV_EDGESEL; + changed = true; + } } } } @@ -871,6 +877,9 @@ static bool uv_rip_object(Scene *scene, Object *obedit, const float co[2], const } } } + if (changed) { + uvedit_deselect_flush(scene, em); + } return changed; } |