Thread View: adobe.after.effects.expressions
4 messages
4 total messages
Started by Taohunter
Thu, 05 Mar 2009 18:22
Expression to control speed with the option to stop?
Author: Taohunter
Date: Thu, 05 Mar 2009 18:22
Date: Thu, 05 Mar 2009 18:22
2 lines
1110 bytes
1110 bytes
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
Re: Expression to control speed with the option to stop?
Author: Rick_Gerard
Date: Fri, 06 Mar 2009 15:32
Date: Fri, 06 Mar 2009 15:32
28 lines
1426 bytes
1426 bytes
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.
Re: Expression to control speed with the option to stop?
Author: Jonas_Hummelstrand
Date: Fri, 06 Mar 2009 18:50
Date: Fri, 06 Mar 2009 18:50
4 lines
853 bytes
853 bytes
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/>
Re: Expression to control speed with the option to stop?
Author: Rick_Gerard
Date: Fri, 06 Mar 2009 22:02
Date: Fri, 06 Mar 2009 22:02
5 lines
1121 bytes
1121 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads