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:
authorAlan <Al@AlanTroth.me.uk>2018-09-18 22:20:14 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-09-18 22:26:22 +0300
commita1a58c8d0a95005d84484b2db90ce2cbabc73316 (patch)
tree22291e4d4357d5fbb12f0cd7be241470802f2c38 /source/blender/editors/uvedit
parent8fc6609cc0085b9c29fbf46bab7742e31fa4af25 (diff)
Fix T54685: EditMesh UV's transform snapping only checks active object
Reviewers: dfelinto https://developer.blender.org/D3653
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index c2cbbf06665..050e40c2ece 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -945,6 +945,30 @@ bool ED_uvedit_nearest_uv(Scene *scene, Object *obedit, Image *ima, const float
return found;
}
+bool ED_uvedit_nearest_uv_multi(
+ struct Scene *scene, struct Image *ima, struct Object **objects_edit,
+ const uint objects_len, const float co[2], float r_uv[2])
+{
+ bool found = false;
+
+ float mindist = FLT_MAX;
+ float uv_nearest[2];
+ for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
+ Object *obedit = objects_edit[ob_index];
+
+ if (ED_uvedit_nearest_uv(scene, obedit, ima, co, uv_nearest)) {
+ float dist = len_manhattan_v2v2(co, uv_nearest);
+ if (dist < mindist) {
+ mindist = dist;
+ copy_v2_v2(r_uv, uv_nearest);
+ found = true;
+ }
+ }
+ }
+
+ return found;
+}
+
/** \} */
/* -------------------------------------------------------------------- */