[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23695] trunk/blender/source/blender/ editors/transform: [#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).

Martin Poirier theeth at yahoo.com
Wed Oct 7 22:55:14 CEST 2009


Revision: 23695
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23695
Author:   theeth
Date:     2009-10-07 22:55:14 +0200 (Wed, 07 Oct 2009)

Log Message:
-----------
[#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).

Modified Paths:
--------------
    trunk/blender/source/blender/editors/transform/transform.c
    trunk/blender/source/blender/editors/transform/transform.h
    trunk/blender/source/blender/editors/transform/transform_constraints.c

Modified: trunk/blender/source/blender/editors/transform/transform.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform.c	2009-10-07 19:29:39 UTC (rev 23694)
+++ trunk/blender/source/blender/editors/transform/transform.c	2009-10-07 20:55:14 UTC (rev 23695)
@@ -773,10 +773,11 @@
 							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 @@
 							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 @@
 						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 @@
 				t->con.mode |= CON_AXIS2;
 			}
 
-			setUserConstraint(t, t->con.mode, "%s");
+			setUserConstraint(t, t->current_orientation, t->con.mode, "%s");
 		}
 	}
 

Modified: trunk/blender/source/blender/editors/transform/transform.h
===================================================================
--- trunk/blender/source/blender/editors/transform/transform.h	2009-10-07 19:29:39 UTC (rev 23694)
+++ trunk/blender/source/blender/editors/transform/transform.h	2009-10-07 20:55:14 UTC (rev 23695)
@@ -548,7 +548,7 @@
 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]);
 

Modified: trunk/blender/source/blender/editors/transform/transform_constraints.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_constraints.c	2009-10-07 19:29:39 UTC (rev 23694)
+++ trunk/blender/source/blender/editors/transform/transform_constraints.c	2009-10-07 20:55:14 UTC (rev 23695)
@@ -551,11 +551,10 @@
 	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];





More information about the Bf-blender-cvs mailing list