ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Marker index for layer index

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ilya Sire
Marker index for layer index
on Sep 19, 2017 at 2:52:27 pm

Hello forum,

Here is the situation. How can i scale in and out like this?
i have 10 comp markers.
and i have 5 layer to zScale.

layer 1: zScale from 100 to 150 (1st marker) and from 150 to 100 (2nd marker)
layer 2: zScale from 100 to 150 (2nd marker) and from150 to 100 (3rd marker)
... i attach the aep sample how it look like.

11698_popupscalecopycc12.aep.zip

thank you~~


Return to posts index

Dan Ebberts
Re: Marker index for layer index
on Sep 19, 2017 at 5:16:38 pm

This should get you started. If you simplify things by making layer 1 the top-most layer in the layer stack (and layer 5 the bottom-most) and add a 6th comp marker to trigger the out ramp of layer 5, you could use something like this:


m = thisComp.marker;
tRamp = 1;
val = value;
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (time < m.key(n).time)n--;
if (n == index){
t = time - m.key(n).time;
val = linear(t,0,tRamp,[100,100],[150,150]);
}else if (n == (index+1)){
t = time - m.key(n).time;
val = linear(t,0,tRamp,[150,150],[100,100]);
}
}
val



Dan



Return to posts index

Ilya Sire
Re: Marker index for layer index
on Sep 19, 2017 at 6:16:41 pm

Yes, it worked. I forgot that. This is right. 1st layer top, last layer bottom.
Thank you a lot for helping me Sir

ilya


Return to posts index

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