Some fix for local axis translation in edit mode. Sorry, I've fixed that weeks ago...
authorMartin Poirier <theeth@yahoo.com>
Mon, 15 Dec 2003 03:13:22 +0000 (03:13 +0000)
committerMartin Poirier <theeth@yahoo.com>
Mon, 15 Dec 2003 03:13:22 +0000 (03:13 +0000)
It wasn't from the bugtracker though.

source/blender/src/editobject.c

index ba350967d456fc398b58b83b487b356cca6d5ac3..db4311e8b1e82983d2522954f8611cad19f9a4eb 100644 (file)
@@ -4225,6 +4225,9 @@ void transform(int mode)
                                if (axismode==XTRANSLOCAL) strcpy(gmode, "Local X: ");
                                if (axismode==YTRANSLOCAL) strcpy(gmode, "Local Y: ");
                                if (axismode==ZTRANSLOCAL) strcpy(gmode, "Local Z: ");
+                               if (axismode==XTRANS) strcpy(gmode, "X Axis: ");
+                               if (axismode==YTRANS) strcpy(gmode, "Y Axis: ");
+                               if (axismode==ZTRANS) strcpy(gmode, "Z Axis: ");
                                
                                if(axismode) {
                                        if(cameragrab) {
@@ -4247,6 +4250,9 @@ void transform(int mode)
                                        dvec[0] = addvec[0];
                                        dvec[1] = addvec[1];
                                        dvec[2] = addvec[2];
+                                       if(axismode == XTRANS) dvec[1]=dvec[2]= 0.0;
+                                       if(axismode == YTRANS) dvec[0]=dvec[2]= 0.0;
+                                       if(axismode == ZTRANS) dvec[0]=dvec[1]= 0.0;
                                }
 
                                /* grids */
@@ -4265,13 +4271,21 @@ void transform(int mode)
                                        /* speedup for vertices */
                                        if (G.obedit) {
                                                VECCOPY(dvecp, dvec);
-                                               Mat3MulVecfl(imat, dvecp);
-                                               if(axismode==XTRANSLOCAL) dvecp[1]=dvecp[2]=0;
-                                               if(axismode==YTRANSLOCAL) dvecp[0]=dvecp[2]=0;
-                                               if(axismode==ZTRANSLOCAL) dvecp[0]=dvecp[1]=0;
-                                               if(axismode&TRANSLOCAL){
+                                               if (axismode&TRANSLOCAL && typemode) {
+                                                       if(axismode==XTRANSLOCAL) dvecp[1]=dvecp[2]=0;
+                                                       if(axismode==YTRANSLOCAL) dvecp[0]=dvecp[2]=0;
+                                                       if(axismode==ZTRANSLOCAL) dvecp[0]=dvecp[1]=0;
                                                        VECCOPY(dvec, dvecp);
-                                                       Mat3MulVecfl(omat, dvec);
+                                               }
+                                               else {
+                                                       Mat3MulVecfl(imat, dvecp);
+                                                       if(axismode==XTRANSLOCAL) dvecp[1]=dvecp[2]=0;
+                                                       if(axismode==YTRANSLOCAL) dvecp[0]=dvecp[2]=0;
+                                                       if(axismode==ZTRANSLOCAL) dvecp[0]=dvecp[1]=0;
+                                                       if(axismode&TRANSLOCAL){
+                                                               VECCOPY(dvec, dvecp);
+                                                               Mat3MulVecfl(omat, dvec);
+                                                       }
                                                }
                                        }