diff options
author | Martin Poirier <theeth@yahoo.com> | 2005-04-24 05:18:13 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2005-04-24 05:18:13 +0400 |
commit | 6379ff9b7046e9286aaa117e98cdaa932480008c (patch) | |
tree | d368612dd2420f314d90e123063d2efca81c4a5a /source/blender/src/transform.c | |
parent | 3c7617de521d9191012b2ef01ee8a396310aaaea (diff) |
Toying a bit with MMB behavior:
MMB click with no constraint selects a constraint right away (the axis selector doesn't flash on screen)
MMB click with a constraint removes the constraint
MMB click-drag in both case (with and without a constraint) uses the axis selector.
stopConstraint didn't remove the CON_SELECT flag, so cancelling transform while selecting a constraint and then reentering transform was funny. Fixed
Diffstat (limited to 'source/blender/src/transform.c')
-rwxr-xr-x | source/blender/src/transform.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index 25011e2f4b4..2c0ee40954c 100755 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -134,7 +134,10 @@ void Transform(int mode, int context) short pmval[2] = {0, 0}, mval[2], val; float mati[3][3]; unsigned short event; + /* constraint mode THIS IS A HACK will have to use con.mode eventually */ char cmode = '\0'; + /* If MMB is pressed or not */ + char mmb_press = 0; /*joeedh -> hopefully may be what makes the old transform() constant*/ /* ton: I doubt, but it doesnt harm for now. shouldnt be needed though */ @@ -226,6 +229,9 @@ void Transform(int mode, int context) getmouseco_areawin(mval); if (mval[0] != pmval[0] || mval[1] != pmval[1]) { + if (mmb_press) { + initSelectConstraint(&Trans, mati); + } Trans.redraw = 1; } if (Trans.redraw) { @@ -272,10 +278,18 @@ void Transform(int mode, int context) initTrackball(&Trans); } } - else - initSelectConstraint(&Trans); + else { + mmb_press = 1; + if (Trans.con.mode & CON_APPLY) { + stopConstraint(&Trans); + } + else { + initSelectConstraint(&Trans, mati); + postSelectConstraint(&Trans); + } + } + Trans.redraw = 1; } - Trans.redraw = 1; break; case ESCKEY: case RIGHTMOUSE: @@ -433,6 +447,7 @@ void Transform(int mode, int context) after releasing modifer key */ case MIDDLEMOUSE: if ((Trans.flag & T_NO_CONSTRAINT)==0) { + mmb_press = 0; postSelectConstraint(&Trans); Trans.redraw = 1; } |