From 31f429a26f2fd120d34d398a78f9682e2eaafa44 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 3 May 2007 10:19:37 +0000 Subject: [PATCH] == IPO Editor - Scaled IPOs == Last few bits and pieces - transforms should now work correctly with scaled IPO's now. --- source/blender/src/editipo.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c index 678ef9252b6..c50fb7b989d 100644 --- a/source/blender/src/editipo.c +++ b/source/blender/src/editipo.c @@ -4514,7 +4514,14 @@ void remake_ipo_transverts(TransVert *transmain, float *dvec, int tot) tv= transmain; for(a=0; aoldloc[0]= tv->loc[0]-dvec[0]; + if (OBACT && OBACT->action && G.sipo->pin==0 && G.sipo->actname) { + tv->oldloc[0] = get_action_frame_inv(OBACT, tv->loc[0]); + tv->oldloc[0]-= dvec[0]; + tv->oldloc[0] = get_action_frame(OBACT, tv->loc[0]); + } + else { + tv->oldloc[0]= tv->loc[0]-dvec[0]; + } tv->oldloc[1]= tv->loc[1]-dvec[1]; } } @@ -4692,7 +4699,15 @@ void transform_ipo(int mode) tv= transmain; for(a=0; aloc[0]= tv->oldloc[0]+vec[0]; + /* adjust times for scaled ipos */ + if (OBACT && OBACT->action && G.sipo->pin==0 && G.sipo->actname) { + tv->loc[0] = get_action_frame_inv(OBACT, tv->oldloc[0]); + tv->loc[0]+= vec[0]; + tv->loc[0] = get_action_frame(OBACT, tv->loc[0]); + } + else { + tv->loc[0]= tv->oldloc[0]+vec[0]; + } if(tv->flag==0) tv->loc[1]= tv->oldloc[1]+vec[1]; } @@ -4718,7 +4733,17 @@ void transform_ipo(int mode) tv= transmain; for(a=0; aloc[0]= size[0]*(tv->oldloc[0]-cent[0])+ cent[0]; + /* adjust times for scaled ipo's */ + if (OBACT && OBACT->action && G.sipo->pin==0 && G.sipo->actname) { + tv->loc[0] = get_action_frame_inv(OBACT, tv->oldloc[0]) - get_action_frame_inv(OBACT, cent[0]); + tv->loc[0]*= size[0]; + tv->loc[0]+= get_action_frame_inv(OBACT, cent[0]); + tv->loc[0] = get_action_frame(OBACT, tv->loc[0]); + } + else { + tv->loc[0]= size[0]*(tv->oldloc[0]-cent[0])+ cent[0]; + } + if(tv->flag==0) tv->loc[1]= size[1]*(tv->oldloc[1]-cent[1])+ cent[1]; }