diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-10-08 00:55:14 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-10-08 00:55:14 +0400 |
commit | a4e36f24c74dfc825347752aae2e55e0247924ef (patch) | |
tree | 1ccdaf537bf6d9a1e9bd141804a57bb36e2ed960 /source | |
parent | ef13a40fed9931cce7db389d50fda547f35a951c (diff) |
[#19354] Second press of axis key didn't do local orientation when global was selected as user orientation (frankly, I don't like it much to have an exception for that, but backward compatibility is ok, unless someone else has a strong argument against).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/transform/transform.c | 17 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.h | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_constraints.c | 5 |
3 files changed, 13 insertions, 11 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 07aedf5e78e..b5920210381 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -773,10 +773,11 @@ void transformEvent(TransInfo *t, wmEvent *event) stopConstraint(t); } else { + short orientation = t->current_orientation != V3D_MANIP_GLOBAL ? t->current_orientation : V3D_MANIP_LOCAL; if ((t->modifiers & MOD_CONSTRAINT_PLANE) == 0) - setUserConstraint(t, (CON_AXIS0), "along %s X"); + setUserConstraint(t, orientation, (CON_AXIS0), "along %s X"); else if (t->modifiers & MOD_CONSTRAINT_PLANE) - setUserConstraint(t, (CON_AXIS1|CON_AXIS2), "locking %s X"); + setUserConstraint(t, orientation, (CON_AXIS1|CON_AXIS2), "locking %s X"); } } } @@ -805,10 +806,11 @@ void transformEvent(TransInfo *t, wmEvent *event) stopConstraint(t); } else { + short orientation = t->current_orientation != V3D_MANIP_GLOBAL ? t->current_orientation : V3D_MANIP_LOCAL; if ((t->modifiers & MOD_CONSTRAINT_PLANE) == 0) - setUserConstraint(t, (CON_AXIS1), "along %s Y"); + setUserConstraint(t, orientation, (CON_AXIS1), "along %s Y"); else if (t->modifiers & MOD_CONSTRAINT_PLANE) - setUserConstraint(t, (CON_AXIS0|CON_AXIS2), "locking %s Y"); + setUserConstraint(t, orientation, (CON_AXIS0|CON_AXIS2), "locking %s Y"); } } } @@ -833,10 +835,11 @@ void transformEvent(TransInfo *t, wmEvent *event) stopConstraint(t); } else { + short orientation = t->current_orientation != V3D_MANIP_GLOBAL ? t->current_orientation : V3D_MANIP_LOCAL; if ((t->modifiers & MOD_CONSTRAINT_PLANE) == 0) - setUserConstraint(t, (CON_AXIS2), "along %s Z"); + setUserConstraint(t, orientation, (CON_AXIS2), "along %s Z"); else if ((t->modifiers & MOD_CONSTRAINT_PLANE) && ((t->flag & T_2D_EDIT)==0)) - setUserConstraint(t, (CON_AXIS0|CON_AXIS1), "locking %s Z"); + setUserConstraint(t, orientation, (CON_AXIS0|CON_AXIS1), "locking %s Z"); } } else if ((t->flag & T_2D_EDIT)==0) { @@ -1511,7 +1514,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int t->con.mode |= CON_AXIS2; } - setUserConstraint(t, t->con.mode, "%s"); + setUserConstraint(t, t->current_orientation, t->con.mode, "%s"); } } diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 2c19bf932eb..ee6871d67bd 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -548,7 +548,7 @@ void drawConstraint(const struct bContext *C, TransInfo *t); void getConstraintMatrix(TransInfo *t); void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[]); void setLocalConstraint(TransInfo *t, int mode, const char text[]); -void setUserConstraint(TransInfo *t, int mode, const char text[]); +void setUserConstraint(TransInfo *t, short orientation, int mode, const char text[]); void constraintNumInput(TransInfo *t, float vec[3]); diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 158ea98c090..1143203217b 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -551,11 +551,10 @@ void setLocalConstraint(TransInfo *t, int mode, const char text[]) { ftext is a format string passed to sprintf. It will add the name of the orientation where %s is (logically). */ -void setUserConstraint(TransInfo *t, int mode, const char ftext[]) { +void setUserConstraint(TransInfo *t, short orientation, int mode, const char ftext[]) { char text[40]; - //short twmode= (t->spacetype==SPACE_VIEW3D)? ((View3D*)t->view)->twmode: V3D_MANIP_GLOBAL; - switch(t->current_orientation) { + switch(orientation) { case V3D_MANIP_GLOBAL: { float mtx[3][3]; |