ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Any "Drift Over Time" expression that ignores scale?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Todd Cannon
Any "Drift Over Time" expression that ignores scale?
on Dec 30, 2016 at 1:01:49 am

Hi there! Long time reader, first time asker.

I'm trying to use the built-in "Drift Over Time" expression on multiple layers in my After Effects comp. However, it appears that each layer's velocity is being affected by its scale. In other words, two layers with different scales will move at different speeds, even when the "speed" setting (in the "Drift Over Time" expression) is exactly the same. This is making me crazy!

The "Throw" behavior in Apple Motion works the way I'd expect: the layer's movement is unaffected by its scale. However, no such luck in AE.

Any suggestions? Thanks very much for your time!

-Todd


Return to posts index

Dan Ebberts
Re: Any "Drift Over Time" expression that ignores scale?
on Dec 30, 2016 at 1:26:04 am

That's because the action is applied to the Transform effect instead of the layer's position property. You could either do your scaling there (in the Transform effect), or you could move the expression to the layer's position property (you'd probably want to change it slightly like this:

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)");
value + [x_offset,y_offset] * driftSpeed * (time-inPoint)


and disable the one in the Transform effect.

Dan



Return to posts index

Todd Cannon
Re: Any "Drift Over Time" expression that ignores scale?
on Dec 30, 2016 at 9:25:53 pm

You, my friend, are a friggin' wizard! This worked perfectly. Thank you very much!


Return to posts index

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