Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Expression to control speed with the option to stop?

115 views
Skip to first unread message

Taoh...@adobeforums.com

unread,
Mar 5, 2009, 1:22:21 PM3/5/09
to
I made a simple animation with an expression to move a layer at a constant speed. With the Separate XYZ effect I used the expression time*120 on the X position. (120 is linked to a slider control but that is irrelevant for the problem)
This works great but now I want to stop the layer for a bit and then move on from that very same spot. And there comes the problem. As soon as I set the speed to 0 the animation jumps to the start. This is pretty obvious because time*0 = 0, but I can't come up with a solution :s

Rick_...@adobeforums.com

unread,
Mar 6, 2009, 10:32:12 AM3/6/09
to
You need to put a little logic into your expression using else if (this is true) { this happens} else (if this is true) {this happens}:

You might consider 3 sliders, one called speed, one called pause, and one called delay. Your expression would look something like this:

p = 3;
s = 100;
d = 2;
st = p+d;

x1 = s * time;
x2 = s * p;
x3 = x2 + s * (time - st);

if (time < p) { xt = x1}; else if (time > st) {
xt = x3};
else {
xt = x2 };

x = value [0] + xt;

y = value [1];
[x, y]

You would replace the values for s, p, and d with a call to your sliders.

If I had AE in front of me I could probably figure out how to get this to ease in and out also.

Hope this helps.

Jonas_Hum...@adobeforums.com

unread,
Mar 6, 2009, 1:50:17 PM3/6/09
to
For your purposes, a quicker and simpler solution would be to avoid tying the animation to the time factor. Instead, tie he position animation to a Slider and keyframe the slider.

- Jonas Hummelstrand
<http://generalspecialist.com/>

Rick_...@adobeforums.com

unread,
Mar 6, 2009, 5:02:12 PM3/6/09
to
I'm with Jonas on this one. Unless you need some specific speed between times keyframes for position would be the easiest.

While I've not used the expression I posted above, If you put some easy ease in there it may be useful for text crawls or rolls. I'm thinking it may be useful for something like a stock ticker that paused every 4 or 5 seconds. Maybe I'll play around with this expression a little more this evening and try and make it ease in and out of the pause.

Rick

0 new messages