Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2007-05-03 14:19:37 +0400
committerJoshua Leung <aligorith@gmail.com>2007-05-03 14:19:37 +0400
commit31f429a26f2fd120d34d398a78f9682e2eaafa44 (patch)
tree9b35eca75c9e95269d68dd00865a45c30f4c2de3 /source
parent165da403adf5d4fe61e7d5f24b1178138c9b845d (diff)
== IPO Editor - Scaled IPOs ==
Last few bits and pieces - transforms should now work correctly with scaled IPO's now.
Diffstat (limited to 'source')
-rw-r--r--source/blender/src/editipo.c31
1 files 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; a<tot; a++, tv++) {
- tv->oldloc[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; a<tot; a++, tv++) {
- tv->loc[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; a<tot; a++, tv++) {
- tv->loc[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];
}