diff options
author | Martin Poirier <theeth@yahoo.com> | 2006-10-26 03:57:00 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2006-10-26 03:57:00 +0400 |
commit | f0dcd2db75b488be000a8be310e1c8a65e85227e (patch) | |
tree | 3b6d968aff79699a54b189412fd96e4679a02785 /source/blender/src/transform.c | |
parent | 2556254e925cb93a203a5801e36fd24d2e44c985 (diff) |
== Transform ==
Embryon functionnality for snapping.
- Only snaps to grid on translations (grab)
- Transform constraints are supported but header display is wrong.
- Can be turned on/off in the Object/Mesh header menu under Transform Properties (tentative spot, will have to integrate better and in other object type menus too)
- Can be turned on/off during transform with ` (Back Quote, also tentative)
This is, of course, very much Work in Progress.
This implements part of the structural ideas for the transform cleanup I've been juggling around with.
Diffstat (limited to 'source/blender/src/transform.c')
-rwxr-xr-x | source/blender/src/transform.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index 1e5f481ac8b..14a41b0a5dc 100755 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -699,6 +699,7 @@ static void transformEvent(unsigned short event, short val) { break; } Trans.redraw |= handleNumInput(&(Trans.num), event); + Trans.redraw |= handleSnapping(&Trans, event); arrows_move_cursor(event); } else { @@ -2053,6 +2054,8 @@ void initTranslation(TransInfo *t) t->snap[0] = 0.0f; t->snap[1] = t->snap[2] = 1.0f; } + + initSnapping(t); } static void headerTranslation(TransInfo *t, float vec[3], char *str) { @@ -2152,14 +2155,16 @@ int Translation(TransInfo *t, short mval[2]) float pvec[3] = {0.0f, 0.0f, 0.0f}; t->con.applyVec(t, NULL, t->vec, tvec, pvec); VECCOPY(t->vec, tvec); + applySnapping(t, t->vec); headerTranslation(t, pvec, str); } else { snapGrid(t, t->vec); applyNumInput(&t->num, t->vec); + applySnapping(t, t->vec); headerTranslation(t, t->vec, str); } - + applyTranslation(t, t->vec); /* evil hack - redo translation if cliiping needeed */ @@ -2169,9 +2174,11 @@ int Translation(TransInfo *t, short mval[2]) recalcData(t); headerprint(str); - + viewRedrawForce(t); + drawSnapping(t); + return 1; } |