ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

expression to offset layers

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Kevin Gonzales
expression to offset layers
on Aug 28, 2019 at 10:55:51 pm


Ive got 36 location points on a map (teardrop look) and all I'm looking to do is have them fall on the map one at at time about 5 frames apart. Is there a simple expression or method to do this instead of keyframing 36 layers?


Kevin Gonzales

Return to posts index

Andrei Popa
Re: expression to offset layers
on Aug 29, 2019 at 8:14:32 am

So keyframe all and put them at the same start. Then add this to the keyframed propeties.

sTime = key(1).time+index*framesToTime(5);
eTime = sTime+(key(2).time-key(1).time);
linear(time,sTime,eTime,key(1).value,key(2).value )

My Envato portfolio.

Return to posts index

Tomas Bumbulevičius
Re: expression to offset layers
on Aug 30, 2019 at 7:47:44 am

Hey Kevin, do those pins has particular order?

Instead of keyframing them all and having to work with a bunch of the same animation around multiple layers, I would suggest to animate only a single item / master, and then link others with delay based from it.

In case if different order of appearance is required, it would need to only shift layers stack.

1. Create null and call it 'control'.
2. Add slider effect to it and call it 'delay' (this will be 'offset time')
3. Add slider effect and call it 'yPos'
4. Animate yPos to reflect pin movement from its original position.
5. Link your master layer's y position to 'yPos' slider: position[1] + yPos (might need to tweak this depending on pos differences)
6. Apply expression below depending on whether your master is above or below (index+1) or (index-1)
7. Adjust 'position' value to match your design needs.

delayFrames = thisComp.layer("control").effect("delay")(1);
delay = framesToTime(delayFrames);
thisComp.layer(index+1).transform.position.valueAtTime(time-delay) //needs custom update to reflect relative yPos

Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer - Dynamic Text Boxes Template with a Live Preview

Return to posts index

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