Discussion:
Expression to control speed with the option to stop?
(too old to reply)
T***@adobeforums.com
2009-03-05 18:22:21 UTC
Permalink
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
R***@adobeforums.com
2009-03-06 15:32:12 UTC
Permalink
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.
J***@adobeforums.com
2009-03-06 18:50:17 UTC
Permalink
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/>
R***@adobeforums.com
2009-03-06 22:02:12 UTC
Permalink
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

Continue reading on narkive:
Loading...