diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_query_uv.c | 25 | ||||
-rw-r--r-- | source/blender/editors/include/ED_mesh.h | 1 | ||||
-rw-r--r-- | source/blender/editors/include/ED_uvedit.h | 3 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_utils.c | 21 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_convert_mesh_uv.c | 9 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 16 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_select.c | 125 |
7 files changed, 43 insertions, 157 deletions
diff --git a/source/blender/bmesh/intern/bmesh_query_uv.c b/source/blender/bmesh/intern/bmesh_query_uv.c index 72f264e148c..b9ea51f0c4d 100644 --- a/source/blender/bmesh/intern/bmesh_query_uv.c +++ b/source/blender/bmesh/intern/bmesh_query_uv.c @@ -32,11 +32,6 @@ #include "bmesh.h" #include "intern/bmesh_private.h" -static bool compare_v2v2_v2(const float v1[2], const float v2[2], const float limit[2]) -{ - return (compare_ff(v1[0], v2[0], limit[0]) && compare_ff(v1[1], v2[1], limit[1])); -} - static void uv_aspect(const BMLoop *l, const float aspect[2], const int cd_loop_uv_offset, @@ -120,26 +115,6 @@ float BM_face_uv_calc_cross(const BMFace *f, const int cd_loop_uv_offset) /** * Check if two loops that share an edge also have the same UV coordinates. */ -bool BM_loop_uv_share_edge_check_with_limit(BMLoop *l_a, - BMLoop *l_b, - const float limit[2], - const int cd_loop_uv_offset) -{ - BLI_assert(l_a->e == l_b->e); - MLoopUV *luv_a_curr = BM_ELEM_CD_GET_VOID_P(l_a, cd_loop_uv_offset); - MLoopUV *luv_a_next = BM_ELEM_CD_GET_VOID_P(l_a->next, cd_loop_uv_offset); - MLoopUV *luv_b_curr = BM_ELEM_CD_GET_VOID_P(l_b, cd_loop_uv_offset); - MLoopUV *luv_b_next = BM_ELEM_CD_GET_VOID_P(l_b->next, cd_loop_uv_offset); - if (l_a->v != l_b->v) { - SWAP(MLoopUV *, luv_b_curr, luv_b_next); - } - return (compare_v2v2_v2(luv_a_curr->uv, luv_b_curr->uv, limit) && - compare_v2v2_v2(luv_a_next->uv, luv_b_next->uv, limit)); -} - -/** - * Check if two loops that share an edge also have the same UV coordinates. - */ bool BM_loop_uv_share_edge_check(BMLoop *l_a, BMLoop *l_b, const int cd_loop_uv_offset) { BLI_assert(l_a->e == l_b->e); diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 046eadb2ec3..392a5075750 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -123,7 +123,6 @@ struct BMFace *EDBM_uv_active_face_get(struct BMEditMesh *em, void BM_uv_vert_map_free(struct UvVertMap *vmap); struct UvMapVert *BM_uv_vert_map_at_index(struct UvVertMap *vmap, unsigned int v); struct UvVertMap *BM_uv_vert_map_create(struct BMesh *bm, - const float limit[2], const bool use_select, const bool use_winding); diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h index b9b8d162d85..c89a9fe0e99 100644 --- a/source/blender/editors/include/ED_uvedit.h +++ b/source/blender/editors/include/ED_uvedit.h @@ -121,7 +121,6 @@ void uvedit_face_select_set_with_sticky(const struct SpaceImage *sima, struct BMFace *efa, const bool select, const bool do_history, - const float limit[2], const int cd_loop_uv_offset); void uvedit_face_select_set(const struct Scene *scene, struct BMEditMesh *em, @@ -145,7 +144,6 @@ void uvedit_edge_select_set_with_sticky(const struct SpaceImage *sima, struct BMLoop *l, const bool select, const bool do_history, - const float limit[2], const uint cd_loop_uv_offset); void uvedit_edge_select_set(const struct Scene *scene, struct BMEditMesh *em, @@ -169,7 +167,6 @@ void uvedit_uv_select_set_with_sticky(const struct SpaceImage *sima, struct BMLoop *l, const bool select, const bool do_history, - const float limit[2], const uint cd_loop_uv_offset); void uvedit_uv_select_set(const struct Scene *scene, struct BMEditMesh *em, diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 2188f758dc7..46c63d2e057 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -525,10 +525,7 @@ void EDBM_flag_enable_all(BMEditMesh *em, const char hflag) /** * Return a new UVVertMap from the editmesh */ -UvVertMap *BM_uv_vert_map_create(BMesh *bm, - const float limit[2], - const bool use_select, - const bool use_winding) +UvVertMap *BM_uv_vert_map_create(BMesh *bm, const bool use_select, const bool use_winding) { BMVert *ev; BMFace *efa; @@ -537,7 +534,7 @@ UvVertMap *BM_uv_vert_map_create(BMesh *bm, /* vars from original func */ UvVertMap *vmap; UvMapVert *buf; - MLoopUV *luv; + const MLoopUV *luv; uint a; int totverts, i, totuv, totfaces; const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV); @@ -609,7 +606,7 @@ UvVertMap *BM_uv_vert_map_create(BMesh *bm, BM_ITER_MESH_INDEX (ev, &iter, bm, BM_VERTS_OF_MESH, a) { UvMapVert *newvlist = NULL, *vlist = vmap->vert[a]; UvMapVert *iterv, *v, *lastv, *next; - float *uv, *uv2, uvdiff[2]; + const float *uv, *uv2; while (vlist) { v = vlist; @@ -633,9 +630,7 @@ UvVertMap *BM_uv_vert_map_create(BMesh *bm, luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); uv2 = luv->uv; - sub_v2_v2v2(uvdiff, uv2, uv); - - if (fabsf(uvdiff[0]) < limit[0] && fabsf(uvdiff[1]) < limit[1] && + if (compare_v2v2(uv2, uv, STD_UV_CONNECT_LIMIT) && (!use_winding || winding[iterv->poly_index] == winding[v->poly_index])) { if (lastv) { lastv->next = next; @@ -777,7 +772,7 @@ UvElementMap *BM_uv_element_map_create(BMesh *bm, BM_ITER_MESH_INDEX (ev, &iter, bm, BM_VERTS_OF_MESH, i) { UvElement *newvlist = NULL, *vlist = element_map->vert[i]; UvElement *iterv, *v, *lastv, *next; - float *uv, *uv2, uvdiff[2]; + const float *uv, *uv2; bool uv_vert_sel, uv2_vert_sel; while (vlist) { @@ -802,12 +797,10 @@ UvElementMap *BM_uv_element_map_create(BMesh *bm, uv2 = luv->uv; uv2_vert_sel = luv->flag & MLOOPUV_VERTSEL; - sub_v2_v2v2(uvdiff, uv2, uv); - /* Check if the uv loops share the same selection state (if not, they are not connected as * they have been ripped or other edit commands have separated them). */ - bool connected = uv_vert_sel == uv2_vert_sel && fabsf(uvdiff[0]) < STD_UV_CONNECT_LIMIT && - fabsf(uvdiff[1]) < STD_UV_CONNECT_LIMIT; + const bool connected = (uv_vert_sel == uv2_vert_sel) && + compare_v2v2(uv2, uv, STD_UV_CONNECT_LIMIT); if (connected && (!use_winding || winding[BM_elem_index_get(iterv->l->f)] == winding[BM_elem_index_get(v->l->f)])) { diff --git a/source/blender/editors/transform/transform_convert_mesh_uv.c b/source/blender/editors/transform/transform_convert_mesh_uv.c index 56fa2d90fb2..f3e7446b2c4 100644 --- a/source/blender/editors/transform/transform_convert_mesh_uv.c +++ b/source/blender/editors/transform/transform_convert_mesh_uv.c @@ -178,9 +178,6 @@ static void uv_set_connectivity_distance(BMesh *bm, float *dists, const float as continue; } - float connected_uv[2]; - float uvdiff[2]; - bool other_vert_sel, connected_vert_sel; other_vert_sel = luv_other->flag & MLOOPUV_VERTSEL; @@ -196,16 +193,12 @@ static void uv_set_connectivity_distance(BMesh *bm, float *dists, const float as MLoopUV *luv_connected = BM_ELEM_CD_GET_VOID_P(l_connected, cd_loop_uv_offset); connected_vert_sel = luv_connected->flag & MLOOPUV_VERTSEL; - copy_v2_v2(connected_uv, luv_connected->uv); - mul_v2_v2(connected_uv, aspect); - sub_v2_v2v2(uvdiff, connected_uv, other_uv); /* Check if this loop is connected in UV space. * If the uv loops share the same selection state (if not, they are not connected as * they have been ripped or other edit commands have separated them). */ bool connected = other_vert_sel == connected_vert_sel && - fabsf(uvdiff[0]) < STD_UV_CONNECT_LIMIT && - fabsf(uvdiff[1]) < STD_UV_CONNECT_LIMIT; + equals_v2v2(luv_other->uv, luv_connected->uv); if (!connected) { continue; } diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index faf8e5013dd..e2368ae6ba8 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -1843,7 +1843,6 @@ static int uv_seams_from_islands_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - const float limit[2] = {STD_UV_CONNECT_LIMIT, STD_UV_CONNECT_LIMIT}; const bool mark_seams = RNA_boolean_get(op->ptr, "mark_seams"); const bool mark_sharp = RNA_boolean_get(op->ptr, "mark_sharp"); bool changed_multi = false; @@ -1884,23 +1883,10 @@ static int uv_seams_from_islands_exec(bContext *C, wmOperator *op) continue; } - const MLoopUV *luv_curr = BM_ELEM_CD_GET_VOID_P(l_iter, cd_loop_uv_offset); - const MLoopUV *luv_next = BM_ELEM_CD_GET_VOID_P(l_iter->next, cd_loop_uv_offset); - bool mark = false; BMLoop *l_other = l_iter->radial_next; do { - const MLoopUV *luv_other_curr = BM_ELEM_CD_GET_VOID_P(l_other, cd_loop_uv_offset); - const MLoopUV *luv_other_next = BM_ELEM_CD_GET_VOID_P(l_other->next, cd_loop_uv_offset); - if (l_iter->v != l_other->v) { - SWAP(const MLoopUV *, luv_other_curr, luv_other_next); - } - - if (!compare_ff(luv_curr->uv[0], luv_other_curr->uv[0], limit[0]) || - !compare_ff(luv_curr->uv[1], luv_other_curr->uv[1], limit[1]) || - - !compare_ff(luv_next->uv[0], luv_other_next->uv[0], limit[0]) || - !compare_ff(luv_next->uv[1], luv_other_next->uv[1], limit[1])) { + if (!BM_loop_uv_share_edge_check(l_iter, l_other, cd_loop_uv_offset)) { mark = true; break; } diff --git a/source/blender/editors/uvedit/uvedit_select.c b/source/blender/editors/uvedit/uvedit_select.c index 77529ca0275..d227fefbdd1 100644 --- a/source/blender/editors/uvedit/uvedit_select.c +++ b/source/blender/editors/uvedit/uvedit_select.c @@ -144,22 +144,16 @@ BMLoop *ED_uvedit_active_edge_loop_get(BMesh *bm) /** \name Visibility and Selection Utilities * \{ */ -static void uv_select_limit_default(SpaceImage *sima, float r_limit[2]) -{ - uvedit_pixel_to_float(sima, 0.05f, r_limit); -} - /** * Apply a penalty to elements that are already selected * so elements that aren't already selected are prioritized. + * + * \note This is calculated in screen-space otherwise zooming in on a uv-vert and + * shift-selecting can consider an adjacent point close enough to add to + * the selection rather than de-selecting the closest. */ static float uv_select_penalty_default(SpaceImage *sima) { - /* Notice 'limit' is the same no matter the zoom level, since this is like - * remove doubles and could annoying if it joined points when zoomed out. - * 'penalty' is in screen pixel space otherwise zooming in on a uv-vert and - * shift-selecting can consider an adjacent point close enough to add to - * the selection rather than de-selecting the closest. */ float penalty[2]; uvedit_pixel_to_float(sima, 5.0f / (sima ? sima->zoom : 1.0f), penalty); return len_v2(penalty); @@ -224,14 +218,13 @@ void uvedit_face_select_set_with_sticky(const SpaceImage *sima, BMFace *efa, const bool select, const bool do_history, - const float limit[2], const int cd_loop_uv_offset) { BMLoop *l_iter, *l_first; l_iter = l_first = BM_FACE_FIRST_LOOP(efa); do { uvedit_uv_select_set_with_sticky( - sima, scene, em, l_iter, select, do_history, limit, cd_loop_uv_offset); + sima, scene, em, l_iter, select, do_history, cd_loop_uv_offset); } while ((l_iter = l_iter->next) != l_first); } @@ -329,13 +322,11 @@ void uvedit_edge_select_set_with_sticky(const struct SpaceImage *sima, BMLoop *l, const bool select, const bool do_history, - const float limit[2], const uint cd_loop_uv_offset) { + uvedit_uv_select_set_with_sticky(sima, scene, em, l, select, do_history, cd_loop_uv_offset); uvedit_uv_select_set_with_sticky( - sima, scene, em, l, select, do_history, limit, cd_loop_uv_offset); - uvedit_uv_select_set_with_sticky( - sima, scene, em, l->next, select, do_history, limit, cd_loop_uv_offset); + sima, scene, em, l->next, select, do_history, cd_loop_uv_offset); } void uvedit_edge_select_set(const Scene *scene, @@ -444,7 +435,6 @@ void uvedit_uv_select_set_with_sticky(const struct SpaceImage *sima, BMLoop *l, const bool select, const bool do_history, - const float limit[2], const uint cd_loop_uv_offset) { const ToolSettings *ts = scene->toolsettings; @@ -477,8 +467,7 @@ void uvedit_uv_select_set_with_sticky(const struct SpaceImage *sima, else { const MLoopUV *luv_other = BM_ELEM_CD_GET_VOID_P(l_radial_iter, cd_loop_uv_offset); - if (fabsf(luv_other->uv[0] - luv->uv[0]) < limit[0] && - fabsf(luv_other->uv[1] - luv->uv[1]) < limit[1]) { + if (equals_v2v2(luv_other->uv, luv->uv)) { do_select = true; } } @@ -560,7 +549,6 @@ void uvedit_uv_select_disable(const Scene *scene, static BMLoop *uvedit_loop_find_other_radial_loop_with_visible_face(Scene *scene, BMLoop *l_src, - const float limit[2], const int cd_loop_uv_offset) { BMLoop *l_other = NULL; @@ -568,7 +556,7 @@ static BMLoop *uvedit_loop_find_other_radial_loop_with_visible_face(Scene *scene if (l_iter != l_src) { do { if (uvedit_face_visible_test(scene, l_iter->f) && - BM_loop_uv_share_edge_check_with_limit(l_src, l_iter, limit, cd_loop_uv_offset)) { + BM_loop_uv_share_edge_check(l_src, l_iter, cd_loop_uv_offset)) { /* Check UV's are contiguous. */ if (l_other == NULL) { l_other = l_iter; @@ -957,8 +945,7 @@ static bool uv_select_edgeloop_edge_tag_faces(BMEditMesh *em, return true; } -static int uv_select_edgeloop( - Scene *scene, Object *obedit, UvNearestHit *hit, const float limit[2], const bool extend) +static int uv_select_edgeloop(Scene *scene, Object *obedit, UvNearestHit *hit, const bool extend) { BMEditMesh *em = BKE_editmesh_from_object(obedit); BMFace *efa; @@ -974,7 +961,7 @@ static int uv_select_edgeloop( /* setup */ BM_mesh_elem_table_ensure(em->bm, BM_FACE); - vmap = BM_uv_vert_map_create(em->bm, limit, false, false); + vmap = BM_uv_vert_map_create(em->bm, false, false); BM_mesh_elem_index_ensure(em->bm, BM_VERT | BM_FACE); @@ -1064,12 +1051,8 @@ static int uv_select_edgeloop( /** \name Edge Ring Select * \{ */ -static int uv_select_edgering(const SpaceImage *sima, - Scene *scene, - Object *obedit, - UvNearestHit *hit, - const float limit[2], - const bool extend) +static int uv_select_edgering( + const SpaceImage *sima, Scene *scene, Object *obedit, UvNearestHit *hit, const bool extend) { BMEditMesh *em = BKE_editmesh_from_object(obedit); bool select; @@ -1091,8 +1074,7 @@ static int uv_select_edgering(const SpaceImage *sima, BMLoop *l_pair[2] = { hit->l, - uvedit_loop_find_other_radial_loop_with_visible_face( - scene, hit->l, limit, cd_loop_uv_offset), + uvedit_loop_find_other_radial_loop_with_visible_face(scene, hit->l, cd_loop_uv_offset), }; for (int side = 0; side < 2; side++) { @@ -1104,11 +1086,11 @@ static int uv_select_edgering(const SpaceImage *sima, } uvedit_face_select_set_with_sticky( - sima, scene, em, l_step->f, select, false, limit, cd_loop_uv_offset); + sima, scene, em, l_step->f, select, false, cd_loop_uv_offset); BM_elem_flag_enable(l_step->f, BM_ELEM_TAG); l_step = uvedit_loop_find_other_radial_loop_with_visible_face( - scene, l_step->next->next, limit, cd_loop_uv_offset); + scene, l_step->next->next, cd_loop_uv_offset); } } @@ -1124,7 +1106,6 @@ static int uv_select_edgering(const SpaceImage *sima, static void uv_select_linked_multi(Scene *scene, Object **objects, const uint objects_len, - const float limit[2], UvNearestHit *hit_final, bool extend, bool deselect, @@ -1159,7 +1140,7 @@ static void uv_select_linked_multi(Scene *scene, * * Better solve this by having a delimit option for select-linked operator, * keeping island-select working as is. */ - vmap = BM_uv_vert_map_create(em->bm, limit, !select_faces, false); + vmap = BM_uv_vert_map_create(em->bm, !select_faces, false); if (vmap == NULL) { continue; @@ -1659,13 +1640,8 @@ void UV_OT_select_all(wmOperatorType *ot) /** \name Mouse Select Operator * \{ */ -static bool uv_sticky_select(const float limit[2], - const int hitv[], - int v, - float *hituv[], - const float uv[2], - int sticky, - int hitlen) +static bool uv_sticky_select( + const int hitv[], int v, float *hituv[], const float uv[2], int sticky, int hitlen) { /* This function test if some vertex needs to selected * in addition to the existing ones due to sticky select */ @@ -1676,7 +1652,7 @@ static bool uv_sticky_select(const float limit[2], for (int i = 0; i < hitlen; i++) { if (hitv[i] == v) { if (sticky == SI_STICKY_LOC) { - if (fabsf(hituv[i][0] - uv[0]) < limit[0] && fabsf(hituv[i][1] - uv[1]) < limit[1]) { + if (equals_v2v2(hituv[i], uv)) { return true; } } @@ -1711,10 +1687,9 @@ static int uv_mouse_select_multi(bContext *C, /* 0 == don't flush, 1 == sel, -1 == desel; only use when selection sync is enabled */ int flush = 0; int hitlen = 0; - float limit[2], **hituv = NULL; + float **hituv = NULL; const float penalty_dist = uv_select_penalty_default(sima); - uv_select_limit_default(sima, limit); /* retrieve operation mode */ if (ts->uv_flag & UV_SYNC_SELECTION) { @@ -1838,7 +1813,7 @@ static int uv_mouse_select_multi(bContext *C, } /* Current behavior of 'extend' * is actually toggling, so pass extend flag as 'toggle' here */ - uv_select_linked_multi(scene, objects, objects_len, limit, &hit, false, false, extend, false); + uv_select_linked_multi(scene, objects, objects_len, &hit, false, false, extend, false); } else if (extend) { if (selectmode == UV_SELECT_VERTEX) { @@ -1879,8 +1854,7 @@ static int uv_mouse_select_multi(bContext *C, BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); - if (uv_sticky_select( - limit, hitv, BM_elem_index_get(l->v), hituv, luv->uv, sticky, hitlen)) { + if (uv_sticky_select(hitv, BM_elem_index_get(l->v), hituv, luv->uv, sticky, hitlen)) { uvedit_uv_select_set(scene, em, l, select, false, cd_loop_uv_offset); } } @@ -1921,8 +1895,7 @@ static int uv_mouse_select_multi(bContext *C, } luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); - if (uv_sticky_select( - limit, hitv, BM_elem_index_get(l->v), hituv, luv->uv, sticky, hitlen)) { + if (uv_sticky_select(hitv, BM_elem_index_get(l->v), hituv, luv->uv, sticky, hitlen)) { uvedit_uv_select_enable(scene, em, l, false, cd_loop_uv_offset); } @@ -2047,7 +2020,6 @@ static int uv_mouse_select_loop_generic_multi(bContext *C, bool found_item = false; /* 0 == don't flush, 1 == sel, -1 == desel; only use when selection sync is enabled */ int flush = 0; - float limit[2]; /* Find edge. */ found_item = uv_find_nearest_edge_multi(scene, objects, objects_len, co, &hit); @@ -2058,8 +2030,6 @@ static int uv_mouse_select_loop_generic_multi(bContext *C, Object *obedit = hit.ob; BMEditMesh *em = BKE_editmesh_from_object(obedit); - uv_select_limit_default(sima, limit); - /* Do selection. */ if (!extend) { /* TODO(MULTI_EDIT): We only need to de-select non-active */ @@ -2067,10 +2037,10 @@ static int uv_mouse_select_loop_generic_multi(bContext *C, } if (loop_type == UV_LOOP_SELECT) { - flush = uv_select_edgeloop(scene, obedit, &hit, limit, extend); + flush = uv_select_edgeloop(scene, obedit, &hit, extend); } else if (loop_type == UV_RING_SELECT) { - flush = uv_select_edgering(sima, scene, obedit, &hit, limit, extend); + flush = uv_select_edgering(sima, scene, obedit, &hit, extend); } else { BLI_assert(0); @@ -2227,11 +2197,9 @@ void UV_OT_select_edge_ring(wmOperatorType *ot) static int uv_select_linked_internal(bContext *C, wmOperator *op, const wmEvent *event, bool pick) { - SpaceImage *sima = CTX_wm_space_image(C); Scene *scene = CTX_data_scene(C); const ToolSettings *ts = scene->toolsettings; ViewLayer *view_layer = CTX_data_view_layer(C); - float limit[2]; bool extend = true; bool deselect = false; bool select_faces = (ts->uv_flag & UV_SYNC_SELECTION) && (ts->selectmode & SCE_SELECT_FACE); @@ -2249,7 +2217,6 @@ static int uv_select_linked_internal(bContext *C, wmOperator *op, const wmEvent extend = RNA_boolean_get(op->ptr, "extend"); deselect = RNA_boolean_get(op->ptr, "deselect"); } - uv_select_limit_default(sima, limit); uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs( @@ -2280,15 +2247,8 @@ static int uv_select_linked_internal(bContext *C, wmOperator *op, const wmEvent uv_select_all_perform_multi(scene, objects, objects_len, SEL_DESELECT); } - uv_select_linked_multi(scene, - objects, - objects_len, - limit, - pick ? &hit : NULL, - extend, - deselect, - false, - select_faces); + uv_select_linked_multi( + scene, objects, objects_len, pick ? &hit : NULL, extend, deselect, false, select_faces); /* weak!, but works */ Object **objects_free = objects; @@ -2633,13 +2593,10 @@ static void uv_select_flush_from_tag_face(SpaceImage *sima, } else if ((ts->uv_flag & UV_SYNC_SELECTION) == 0 && sima->sticky == SI_STICKY_LOC) { struct UvVertMap *vmap; - float limit[2]; uint efa_index; - uv_select_limit_default(sima, limit); - BM_mesh_elem_table_ensure(em->bm, BM_FACE); - vmap = BM_uv_vert_map_create(em->bm, limit, false, false); + vmap = BM_uv_vert_map_create(em->bm, false, false); if (vmap == NULL) { return; } @@ -2720,13 +2677,10 @@ static void uv_select_flush_from_tag_loop(SpaceImage *sima, } else if ((ts->uv_flag & UV_SYNC_SELECTION) == 0 && sima->sticky == SI_STICKY_LOC) { struct UvVertMap *vmap; - float limit[2]; uint efa_index; - uv_select_limit_default(sima, limit); - BM_mesh_elem_table_ensure(em->bm, BM_FACE); - vmap = BM_uv_vert_map_create(em->bm, limit, false, false); + vmap = BM_uv_vert_map_create(em->bm, false, false); if (vmap == NULL) { return; } @@ -2774,7 +2728,6 @@ static int uv_box_select_exec(bContext *C, wmOperator *op) MLoopUV *luv; rctf rectf; bool pinned; - float limit[2]; const bool use_face_center = ((ts->uv_flag & UV_SYNC_SELECTION) ? (ts->selectmode == SCE_SELECT_FACE) : (ts->uv_selectmode == UV_SELECT_FACE)); @@ -2792,8 +2745,6 @@ static int uv_box_select_exec(bContext *C, wmOperator *op) pinned = RNA_boolean_get(op->ptr, "pinned"); - uv_select_limit_default(sima, limit); - bool changed_multi = false; uint objects_len = 0; @@ -2905,8 +2856,7 @@ static int uv_box_select_exec(bContext *C, wmOperator *op) .ob = obedit, .efa = efa, }; - uv_select_linked_multi( - scene, objects, objects_len, limit, &hit, true, !select, false, false); + uv_select_linked_multi(scene, objects, objects_len, &hit, true, !select, false, false); } } @@ -3001,7 +2951,7 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op) MLoopUV *luv; int x, y, radius, width, height; float zoomx, zoomy; - float limit[2], offset[2], ellipse[2]; + float offset[2], ellipse[2]; const bool use_face_center = ((ts->uv_flag & UV_SYNC_SELECTION) ? (ts->selectmode == SCE_SELECT_FACE) : @@ -3025,8 +2975,6 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op) UI_view2d_region_to_view(®ion->v2d, x, y, &offset[0], &offset[1]); - uv_select_limit_default(sima, limit); - bool changed_multi = false; uint objects_len = 0; @@ -3128,8 +3076,7 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op) .ob = obedit, .efa = efa, }; - uv_select_linked_multi( - scene, objects, objects_len, limit, &hit, true, !select, false, false); + uv_select_linked_multi(scene, objects, objects_len, &hit, true, !select, false, false); } } @@ -3220,12 +3167,9 @@ static bool do_lasso_select_mesh_uv(bContext *C, BMFace *efa; BMLoop *l; - float limit[2]; bool changed_multi = false; rcti rect; - uv_select_limit_default(sima, limit); - BLI_lasso_boundbox(&rect, mcoords, mcoords_len); uint objects_len = 0; @@ -3327,8 +3271,7 @@ static bool do_lasso_select_mesh_uv(bContext *C, .ob = obedit, .efa = efa, }; - uv_select_linked_multi( - scene, objects, objects_len, limit, &hit, true, !select, false, false); + uv_select_linked_multi(scene, objects, objects_len, &hit, true, !select, false, false); } } |