Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-08-11 09:34:50 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-08-11 09:34:50 +0300
commit77c4ed1d0442f596b666f3ee6309c86f09511061 (patch)
tree7fce98715bf28b37b3505d8c76ef7d1f3b3fcc75 /source/blender/editors/uvedit
parentfb049a79761f50aefc4b4f86a23f0c9358928ccc (diff)
parent23a6b5d91e942d90badeaf9ab64cf8ea3b4219a1 (diff)
Merge branch 'blender-v2.90-release' into master
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r--source/blender/editors/uvedit/uvedit_intern.h1
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c16
-rw-r--r--source/blender/editors/uvedit/uvedit_select.c8
3 files changed, 4 insertions, 21 deletions
diff --git a/source/blender/editors/uvedit/uvedit_intern.h b/source/blender/editors/uvedit/uvedit_intern.h
index 7455004ccb8..5a510aaf945 100644
--- a/source/blender/editors/uvedit/uvedit_intern.h
+++ b/source/blender/editors/uvedit/uvedit_intern.h
@@ -33,7 +33,6 @@ struct wmOperatorType;
/* geometric utilities */
void uv_poly_copy_aspect(float uv_orig[][2], float uv[][2], float aspx, float aspy, int len);
-void uv_poly_center(struct BMFace *f, float r_cent[2], const int cd_loop_uv_offset);
/* find nearest */
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 956c094c19b..d3d8c58829b 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -227,22 +227,6 @@ void uvedit_live_unwrap_update(SpaceImage *sima, Scene *scene, Object *obedit)
/** \name Geometric Utilities
* \{ */
-void uv_poly_center(BMFace *f, float r_cent[2], const int cd_loop_uv_offset)
-{
- BMLoop *l;
- MLoopUV *luv;
- BMIter liter;
-
- zero_v2(r_cent);
-
- BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
- luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
- add_v2_v2(r_cent, luv->uv);
- }
-
- mul_v2_fl(r_cent, 1.0f / (float)f->len);
-}
-
void uv_poly_copy_aspect(float uv_orig[][2], float uv[][2], float aspx, float aspy, int len)
{
int i;
diff --git a/source/blender/editors/uvedit/uvedit_select.c b/source/blender/editors/uvedit/uvedit_select.c
index 151c881a466..149c5cf1f96 100644
--- a/source/blender/editors/uvedit/uvedit_select.c
+++ b/source/blender/editors/uvedit/uvedit_select.c
@@ -724,7 +724,7 @@ bool uv_find_nearest_face(Scene *scene, Object *obedit, const float co[2], UvNea
}
float cent[2];
- uv_poly_center(efa, cent, cd_loop_uv_offset);
+ BM_face_uv_calc_center_median(efa, cd_loop_uv_offset, cent);
const float dist_test_sq = len_squared_v2v2(co, cent);
@@ -2841,7 +2841,7 @@ static int uv_box_select_exec(bContext *C, wmOperator *op)
BM_elem_flag_disable(efa, BM_ELEM_TAG);
if (uvedit_face_visible_test(scene, efa)) {
- uv_poly_center(efa, cent, cd_loop_uv_offset);
+ BM_face_uv_calc_center_median(efa, cd_loop_uv_offset, cent);
if (BLI_rctf_isect_pt_v(&rectf, cent)) {
BM_elem_flag_enable(efa, BM_ELEM_TAG);
changed = true;
@@ -3072,7 +3072,7 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op)
/* assume not touched */
if (select != uvedit_face_select_test(scene, efa, cd_loop_uv_offset)) {
float cent[2];
- uv_poly_center(efa, cent, cd_loop_uv_offset);
+ BM_face_uv_calc_center_median(efa, cd_loop_uv_offset, cent);
if (uv_circle_select_is_point_inside(cent, offset, ellipse)) {
BM_elem_flag_enable(efa, BM_ELEM_TAG);
changed = true;
@@ -3263,7 +3263,7 @@ static bool do_lasso_select_mesh_uv(bContext *C,
/* assume not touched */
if (select != uvedit_face_select_test(scene, efa, cd_loop_uv_offset)) {
float cent[2];
- uv_poly_center(efa, cent, cd_loop_uv_offset);
+ BM_face_uv_calc_center_median(efa, cd_loop_uv_offset, cent);
if (do_lasso_select_mesh_uv_is_point_inside(region, &rect, mcoords, mcoords_len, cent)) {
BM_elem_flag_enable(efa, BM_ELEM_TAG);
changed = true;