Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Marker index for layer index

  • Marker index for layer index

    Posted by Ilya Sire on September 19, 2017 at 2:52 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~~

    Ilya Sire replied 8 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    September 19, 2017 at 5:16 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

  • Ilya Sire

    September 19, 2017 at 6:16 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

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy