ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression marker on layer

FAQ   •   VIEW ALL
 Expression marker on layer on Nov 20, 2018 at 4:12:07 pm

Hi guys!

I need a little help. I have the following expression:

maxDev = 13; // max deviation in pixels
spd = 30; //speed of oscillation
decay = 1.0; //how fast it slows down
t = time - inPoint;
x = scale[0] + maxDev*Math.sin(spd*t)/Math.exp(decay*t);
y = scale[0]*scale[1]/x;
[x,y]

In it the animation starts at the beginning of the layer, I need it to start in a marker that I created in that same layer. Can you help me?

```maxDev = 13; // max deviation in pixels spd = 30; //speed of oscillation decay = 1.0; //how fast it slows down t = time - inPoint; x = scale[0] + maxDev*Math.sin(spd*t)/Math.exp(decay*t); y = scale[0]*scale[1]/x; [x,y]```

 Re: Expression marker on layeron Nov 20, 2018 at 4:35:37 pm

Here you go:

``` m = marker; if (m.numKeys > 0 && time > m.key(1).time){ maxDev = 13; // max deviation in pixels spd = 30; //speed of oscillation decay = 1.0; //how fast it slows down t = time - m.key(1).time; x = scale[0] + maxDev*Math.sin(spd*t)/Math.exp(decay*t); y = scale[0]*scale[1]/x; [x,y] }else value ```

Dan