ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Offset Position AND TIME expression

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jennifer Arani
Offset Position AND TIME expression
on Sep 11, 2012 at 11:22:18 pm

Hello Everyone,
I am trying to create an expression that will help me animate 15 pages of a pdf. I have the keyframe set for page 1.
I want the other pages to fall in but moved over a hair on both x and y and their movement spaced out as well.

So I found a thread that KINDA helps, but it only solves 1/2 my problem:
http://forums.creativecow.net/readpost/2/875415

And I have a script ALOT like it:
offset = -.5;
p = thisComp.layer("Page 1/ProtectorPlus.psd");
t = time + offset;
p.position.valueAtTime(t);

So - For TIME this is GREAT works like a charm. For position offset, no so much!
I have some code I made up with my whole 6 hours of expression experience, so only laugh a little at how bad it is. This works for the spacing but not the time:

offset = index - 1;
xNum = thisComp.layer("Page 1/ProtectorPlus.psd").position[0];
yNum = thisComp.layer("Page 1/ProtectorPlus.psd").position[1];
zNum = thisComp.layer("Page 1/ProtectorPlus.psd").position[2];
x = xNum - offset+100;
y = yNum - offset+50;
z = zNum;
[x,y,z]

How the Heck do I COMBINE the first code and the second?! So my papers space correctly over time?

thanks
Jennifer

Jennifer Arani


Return to posts index

Cassius Marques
Re: Offset Position AND TIME expression
on Sep 12, 2012 at 1:17:18 pm

I suck at expressions, but I'll try to help.

First you have two different values for the variable offset...You'll need to rename one.
Since your first expression already instances your posisiton you won't need to do it again on the second one... so i'm gessing you'll just need to give it the position offset you want.

Try something like

offset = -.5;
p = thisComp.layer("Page 1/ProtectorPlus.psd");
t = time + offset;
r = p.position.valueAtTime(t);
noffset = index - 1;
[r[0] - noffset+100, r[1] - noffset+50, r[2]]

Give me some feedback of what you got.


Return to posts index

Cassius Marques
Re: Offset Position AND TIME expression
on Sep 12, 2012 at 1:26:57 pm

Thinking about it, this will probably work only for the first layer (page 2)...but I'll wait for you to check it out.


Return to posts index


Kevin Camp
Re: Offset Position AND TIME expression
on Sep 13, 2012 at 3:07:40 pm

if cassius's expression did not work, i think this is what you are looking for:

Delay = .5; // value in seconds
Offset = [100,50,0]; // offset position array [x,y,z]
PreviousLayer = thisComp.layer(index-1); // this looks at the layer right above it
PreviousLayer.position.valueAtTime(time - Delay) + Offset; // this puts it all together

Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW


Return to posts index

Dave LaRonde
Re: Offset Position AND TIME expression
on Sep 12, 2012 at 2:53:21 pm

You're dealing with two different properties. Therefore you need one expression for each of them.

Dave LaRonde
Sr. Promotion Producer
KCRG-TV (ABC) Cedar Rapids, IA


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]