FORUMS: list search recent posts

Simple continuous movement

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Anwar Hoogland
Simple continuous movement
on Oct 21, 2010 at 7:02:01 pm

I'm working on an animation where the various video's keep moving past the camera in a steady motion. But at some points the movement needs to stop. I figured this would be pretty doable with an expression in combination with a slider control to control the speed.

The code I initially got (below) didn't have the slider control but it turns out this is a problem.
When I animate the slider from 0 to 150 it speeds up dramatically to a speed that looks more like 2000 and then when it passes the 150 keyframe it continues on at the intended 150 speed

anyone have an idea of what's causing this?

t=time*effect("Slider Control")("Slider");

Return to posts index

Michael Szalapski
Re: Simple continuous movement
on Oct 21, 2010 at 7:56:42 pm

Here's one idea: Parent all the layers to a null object, then parent that null to another null. Make one of the nulls the continuous slow movement that you want, then keyframe the other one for when you want fast motion.

- The Great Szalam
(The 'Great' stands for 'Not So Great, in fact, Extremely Humble')

No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.

Return to posts index

Anwar Hoogland
Re: Simple continuous movement
on Oct 22, 2010 at 6:04:54 pm

Thanks for the reply Michael, that's also a good way to look at it and I'll surely keep that in mind :)

But after a long search last night I finally found what I was looking for. I'm not sure what it all means but it does exactly what I wanted.
I can completely control the speed of the animation by setting the Slider control to the speed I want. :)

Td = framesToTime(1, 1.0 / thisComp.frameDuration);
x = 0;
v = effect("Slider Control")("Slider");
n = timeToFrames(time + thisComp.displayStartTime, 1.0 / thisComp.frameDuration);
for (k=0; k&lt;=n; k++)
x = x - v.valueAtTime(k*Td);

x = x + position[0];
y = position[1];

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved