From 7b5fe4f316234022a0ab761b694cd459ce98db2d Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Thu, 12 Jun 2014 01:43:38 +0300 Subject: Fix flickering when transform snapping in edit mode and cursor is slightly outside the mesh. Reported by Thomas Beck on irc. Issue here is that the mesh bounding box changes as we are transforming the vertices. Solution is to collide against the initial bounding box. Unfortunately the snapping functions are made in a way that a lot of code needed to be tweaked here, but the change should be straightforward and harmless (famous last words, I know). Ideally we might want to even increase the size of the bounding box a little (as seen in screen space) to allow snapping even in cases where, cursor is slightly outside the bounding box, but since this is not so straightforward to do for all cases, at least for me, leaving this as a TODO. --- source/blender/editors/space_view3d/view3d_walk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_view3d/view3d_walk.c') diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c index 1c3e223f3ed..991c38fd778 100644 --- a/source/blender/editors/space_view3d/view3d_walk.c +++ b/source/blender/editors/space_view3d/view3d_walk.c @@ -393,7 +393,7 @@ static bool walk_floor_distance_get(bContext *C, RegionView3D *rv3d, WalkInfo *w ret = snapObjectsRayEx(CTX_data_scene(C), NULL, NULL, NULL, NULL, SCE_SNAP_MODE_FACE, NULL, NULL, ray_start, ray_normal, r_distance, - NULL, &dummy_dist_px, r_location, r_normal, SNAP_ALL); + NULL, &dummy_dist_px, r_location, r_normal, SNAP_ALL, NULL); /* artifically scale the distance to the scene size */ *r_distance /= walk->grid; @@ -426,7 +426,7 @@ static bool walk_ray_cast(bContext *C, RegionView3D *rv3d, WalkInfo *walk, float ret = snapObjectsRayEx(CTX_data_scene(C), NULL, NULL, NULL, NULL, SCE_SNAP_MODE_FACE, NULL, NULL, ray_start, ray_normal, ray_distance, - NULL, &dummy_dist_px, r_location, r_normal, SNAP_ALL); + NULL, &dummy_dist_px, r_location, r_normal, SNAP_ALL, NULL); /* dot is positive if both rays are facing the same direction */ -- cgit v1.2.3