From 21f376780941f986e99db83793409c3222bca091 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Fri, 3 Feb 2017 13:15:44 -0300 Subject: fix T46892: snap to closest point now works with Individual Origins The code looks for the closest element between its centers. In the case of islands, the center of each vertex is the center of the island. The solution here is to skip the search for islands when the operation is translation --- source/blender/editors/transform/transform_conversions.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index ce3d903b8f6..091a5773cf0 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2393,7 +2393,12 @@ static void createTransEditVerts(TransInfo *t) editmesh_set_connectivity_distance(em->bm, mtx, dists); } - if (t->around == V3D_AROUND_LOCAL_ORIGINS) { + /* Only in case of rotation and resize, we want the elements of the edited + * object to behave as groups whose pivot are the individual origins + * + * TODO: use island_info to detect the closest point when the "Snap Target" + * in Blender UI is "Closest" */ + if ((t->around == V3D_AROUND_LOCAL_ORIGINS) && (t->mode != TFM_TRANSLATION)) { island_info = editmesh_islands_info_calc(em, &island_info_tot, &island_vert_map); } -- cgit v1.2.3