diff options
author | Alan <Al@AlanTroth.me.uk> | 2018-09-18 22:20:14 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-09-18 22:26:22 +0300 |
commit | a1a58c8d0a95005d84484b2db90ce2cbabc73316 (patch) | |
tree | 22291e4d4357d5fbb12f0cd7be241470802f2c38 /source/blender/editors/transform/transform_snap.c | |
parent | 8fc6609cc0085b9c29fbf46bab7742e31fa4af25 (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/transform/transform_snap.c')
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 8188cb3f51c..23daee61d71 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -53,6 +53,7 @@ #include "GPU_state.h" #include "BKE_global.h" +#include "BKE_layer.h" #include "BKE_object.h" #include "BKE_anim.h" /* for duplis */ #include "BKE_context.h" @@ -991,7 +992,11 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec)) UI_view2d_region_to_view(&t->ar->v2d, t->mval[0], t->mval[1], &co[0], &co[1]); - if (ED_uvedit_nearest_uv(t->scene, TRANS_DATA_CONTAINER_FIRST_EVIL(t)->obedit, ima, co, t->tsnap.snapPoint)) { + uint objects_len = 0; + Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs( + t->view_layer, &objects_len); + + if (ED_uvedit_nearest_uv_multi(t->scene, ima, objects, objects_len, co, t->tsnap.snapPoint)) { t->tsnap.snapPoint[0] *= t->aspect[0]; t->tsnap.snapPoint[1] *= t->aspect[1]; @@ -1000,6 +1005,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec)) else { t->tsnap.status &= ~POINT_INIT; } + MEM_freeN(objects); } } else if (t->spacetype == SPACE_NODE) { |