FORUMS: list search recent posts

ending "drift over time" parented to null

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Aj Kolb
ending "drift over time" parented to null
on Oct 4, 2012 at 5:09:54 pm

Hello,
I have a null with keyframes that brings a parented solid into view. I want to add a slight drift to the solid with either a stand alone expression or some modification of the "drift over time" effect. I can't seem to get the drift over time to stop at a certain frame or timecode. Any ideas? Thanks!


Return to posts index

Dan Ebberts
Re: ending "drift over time" parented to null
on Oct 4, 2012 at 5:15:16 pm

Here' how you could change the Drift Over Time expression to stop drifting after 5 seconds:

tStop = 5;
driftDirection = degreesToRadians(effect("Drift Over Time")("Direction") - 90);
x_offset = Math.cos(driftDirection);
y_offset = Math.sin(driftDirection);
driftSpeed = effect("Drift Over Time")("Speed (pixels/second)");
[x_offset,y_offset] * driftSpeed * (Math.min(time,tStop)-inPoint)



Return to posts index

Aj Kolb
Re: ending "drift over time" parented to null
on Oct 4, 2012 at 5:25:53 pm

Ah Dan that works great! Thank you. Now any chance of easing the end of the drift? Seems its linear by default?

I have this at the end but I dont think its doing what I think it should:

easeTime=2;

if (time-inPoint &lt;= easeTime) {[x_offset,y_offset] * linear(time,0,easeTime,0,driftSpeed) * (time-inPoint)} else {[x_offset,y_offset] * driftSpeed * (time-inPoint)};


Return to posts index



Dan Ebberts
Re: ending "drift over time" parented to null
on Oct 4, 2012 at 9:57:41 pm

This one was tricky to figure out, but very educational. This will begin to slow down at 5 seconds and ease to a complete stop over the next second:


tSlow = 5;
tEase = 1;
driftDirection = degreesToRadians(effect("Drift Over Time")("Direction") - 90);
x_offset = Math.cos(driftDirection);
y_offset = Math.sin(driftDirection);
driftSpeed = effect("Drift Over Time")("Speed (pixels/second)");
if (time-inPoint < tSlow){
d = driftSpeed*(time-inPoint);
}else{
if ((time-inPoint) < tSlow + tEase){
t = (time-inPoint-tSlow)/tEase;
d = driftSpeed*(tSlow + tEase*t*(1 - t*t/3));
}else{
d = driftSpeed*(tSlow + tEase*2/3);
}
}
[x_offset,y_offset] * d



Dan



Return to posts index

Aj Kolb
Re: ending "drift over time" parented to null
on Oct 4, 2012 at 11:58:06 pm

Dan you are amazing, this works like a charm! I wasn't trying to stump you I swear haha. Thanks again


Return to posts index

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