diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-25 13:39:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-25 13:39:03 +0400 |
commit | a25703eb36c6d88d93e2d0645d413c339ce82d36 (patch) | |
tree | cf92024773423db01538b3cda2cc926526a3e2e8 /source/blender/editors/transform | |
parent | 16f61b8b0b7c29aab69f359c2b0d172d960d425f (diff) |
ruler snap adjustments
- when in wireframe mode: don't snap to faces, instead snap to the closest edge/vertex.
- when not in wireframe mode: snap to the front-most element (was a problem that it could snap to an edge/vert behind the face)
- reduce the distance for selecting ruler points, was too easy to accidentally drag a ruler.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index bb2ba2b6e3b..6b529e13aec 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1615,10 +1615,10 @@ static bool snapObjectsRay(Scene *scene, short snap_mode, Base *base_act, View3D return retval; } static bool snapObjects(Scene *scene, short snap_mode, Base *base_act, View3D *v3d, ARegion *ar, Object *obedit, - const float mval[2], float *r_dist_px, float r_loc[3], float r_no[3], SnapMode mode) + const float mval[2], float *r_dist_px, + float r_loc[3], float r_no[3], float *r_ray_dist, SnapMode mode) { float ray_start[3], ray_normal[3]; - float ray_dist = TRANSFORM_DIST_MAX_RAY; if (ED_view3d_win_to_ray(ar, v3d, mval, ray_start, ray_normal, true) == false) { return false; @@ -1626,14 +1626,15 @@ static bool snapObjects(Scene *scene, short snap_mode, Base *base_act, View3D *v return snapObjectsRay(scene, snap_mode, base_act, v3d, ar, obedit, NULL, NULL, - ray_start, ray_normal, &ray_dist, + ray_start, ray_normal, r_ray_dist, mval, r_dist_px, r_loc, r_no, mode); } bool snapObjectsTransform(TransInfo *t, const float mval[2], float *r_dist_px, float r_loc[3], float r_no[3], SnapMode mode) { + float ray_dist = TRANSFORM_DIST_MAX_RAY; return snapObjects(t->scene, t->scene->toolsettings->snap_mode, t->scene->basact, t->view, t->ar, t->obedit, - mval, r_dist_px, r_loc, r_no, mode); + mval, r_dist_px, r_loc, r_no, &ray_dist, mode); } bool snapObjectsContext(bContext *C, const float mval[2], float *r_dist_px, float r_loc[3], float r_no[3], SnapMode mode) @@ -1643,15 +1644,19 @@ bool snapObjectsContext(bContext *C, const float mval[2], float *r_dist_px, floa Scene *scene = CTX_data_scene(C); ARegion *ar = CTX_wm_region(C); Object *obedit = CTX_data_edit_object(C); + float ray_dist = TRANSFORM_DIST_MAX_RAY; - return snapObjects(scene, scene->toolsettings->snap_mode, scene->basact, v3d, ar, obedit, mval, r_dist_px, r_loc, r_no, mode); + return snapObjects(scene, scene->toolsettings->snap_mode, scene->basact, v3d, ar, obedit, + mval, r_dist_px, r_loc, r_no, &ray_dist, mode); } bool snapObjectsEx(Scene *scene, Base *base_act, View3D *v3d, ARegion *ar, Object *obedit, short snap_mode, - const float mval[2], float *r_dist_px, float r_loc[3], float r_no[3], SnapMode mode) + const float mval[2], float *r_dist_px, + float r_loc[3], float r_no[3], float *r_ray_dist, SnapMode mode) { return snapObjects(scene, snap_mode, base_act, v3d, ar, obedit, - mval, r_dist_px, r_loc, r_no, mode); + mval, r_dist_px, + r_loc, r_no, r_ray_dist, mode); } bool snapObjectsRayEx(Scene *scene, Base *base_act, View3D *v3d, ARegion *ar, Object *obedit, short snap_mode, Object **r_ob, float r_obmat[4][4], |