Page MenuHome

ipo_transform_axislocking_01.patch

ipo_transform_axislocking_01.patch

Index: blender/src/editipo.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/editipo.c,v
retrieving revision 1.103
diff -u -r1.103 editipo.c
--- blender/src/editipo.c 4 Sep 2006 13:05:20 -0000 1.103
+++ blender/src/editipo.c 28 Sep 2006 03:46:21 -0000
@@ -3894,7 +3980,7 @@
BezTriple *bezt;
TransVert *transmain = NULL, *tv;
float xref=1.0, yref=1.0, dx, dy, dvec[2], min[3], max[3], vec[2], div, cent[2], size[2], sizefac;
- int tot=0, a, b, firsttime=1, afbreek=0, midtog= 0, dosort, proj = 0;
+ int tot=0, a, b, firsttime=1, afbreek=0, midtog= 0, dosort, proj = 0, clampAxis=0;
unsigned short event = 0;
short mval[2], val, xo, yo, xn, yn, xc, yc;
char str[64];
@@ -4058,9 +4144,11 @@
tv= transmain;
for(a=0; a<tot; a++, tv++) {
- tv->loc[0]= tv->oldloc[0]+vec[0];
+ if ((clampAxis & 2)==0)
+ tv->loc[0]= tv->oldloc[0]+vec[0];
- if(tv->flag==0) tv->loc[1]= tv->oldloc[1]+vec[1];
+ if ((clampAxis & 1)==0)
+ tv->loc[1]= tv->oldloc[1]+vec[1];
}
sprintf(str, "X: %.3f Y: %.3f ", vec[0], vec[1]);
@@ -4180,9 +4268,39 @@
}
break;
case XKEY:
+ if(mode=='g') {
+ /* grab */
+ if (clampAxis & 2) {
+ clampAxis &= ~2;
+ clampAxis |= 1;
+ }
+ else if (clampAxis & 1)
+ clampAxis &= ~1;
+ else
+ clampAxis |= 1;
+ }
+ else {
+ /* assume to be scaling */
+ xref= -xref;
+ }
+ firsttime= 1;
+ break;
case YKEY:
- if(event==XKEY) xref= -xref;
- else if(G.sipo->showkey==0) yref= -yref;
+ if(mode=='g') {
+ /* grab */
+ if (clampAxis & 1) {
+ clampAxis &= ~1;
+ clampAxis |= 2;
+ }
+ else if (clampAxis & 2)
+ clampAxis &= ~2;
+ else
+ clampAxis |= 2;
+ }
+ else {
+ /* assume to be scaling */
+ if (G.sipo->showkey==0) yref= -yref;
+ }
firsttime= 1;
break;
case LEFTCTRLKEY:

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
e6/da/64c85ed2f39716b1317cc48a388c

Event Timeline