ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Ease in to and out of a sin wave position move via layer marker??

FAQ   •   VIEW ALL
 Ease in to and out of a sin wave position move via layer marker?? on Dec 9, 2017 at 6:35:55 am

So I want a an object to be stationary then it eases into a sin wave up and down motion(position). Then eases back into its original stationary position. And it should be activated with 2 layer markers. First one starts the ease motion then the second one eases it back into rest. And also an option for how long the ease would last. From 10 frame ease or a 30 frame ease into a sin wave that can be controlled based on Frequency and amplitude. Can you help?

 Re: Ease in to and out of a sin wave position move via layer marker??on Dec 10, 2017 at 12:06:58 am

Something like this maybe:

``` easeFrames = 10; freq = 5; amp = 50; if (marker.numKeys > 1){ t1 = marker.key(1).time; t2 = marker.key(2).time; easeSec = framesToTime(easeFrames); if (time < t2) a = ease(time,t1,t1+easeSec,0,amp) else a = ease(time,t2,t2+easeSec,amp,0); y = a*Math.sin(freq*(time-t1)*Math.PI*2); value + [0,y] }else value ```

Dan

 Re: Ease in to and out of a sin wave position move via layer marker??on Dec 10, 2017 at 6:45:07 am

Okay this is working but is it possible to have the ease finish before the second marker. Currently where the 2nd marker is placed it starts to ease after the marker. I essential would like all the animation to occur within the inside range of the 1st & 2nd marker. Thanks.

 Re: Ease in to and out of a sin wave position move via layer marker??on Dec 10, 2017 at 8:16:48 am

Like this, I guess:

``` easeFrames = 10; freq = 5; amp = 50; if (marker.numKeys > 1){ t1 = marker.key(1).time; t2 = marker.key(2).time; easeSec = framesToTime(easeFrames); if (time < (t1+t2)/2) a = ease(time,t1,t1+easeSec,0,amp) else a = ease(time,t2-easeSec,t2,amp,0); y = a*Math.sin(freq*(time-t1)*Math.PI*2); value + [0,y] }else value ```

Dan