Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expressions and Sequence Layers

  • Expressions and Sequence Layers

    Posted by Stefan Van mourik on January 8, 2013 at 7:33 pm

    Hi There,

    I am fairly new to the expressions in After Effects but I’m getting really interested.

    I now have the following issue:

    Let’s say I have a comp with 5 layers. Every layer has a duration of 3 seconds and I use “sequence layers” to make them appear after each other with an overlap of 1 second.

    No biggie here.

    Now for my first layer (layer1) I have made a fade-in. 0 sec Opacity = 0%, 1 sec Opacity = 100%.

    I apply the same effect to the others, by using the expression:

    thisComp.layer(“layer1”).transform.opacity

    So that in the future, I only have to adjust my first layers timing of opacity and it will change for all the others as well, instead of copy-pasting…. (in the real project I have about 148 layers)

    Now as you might expect, this effect doesn’t work when I apply the “sequence layers” to it, since layer2 will start later than layer1 and therefore will already have a 100% opacity.

    So here is my question:


    What would the expression look like when it automatically adapts the time in between the layers?

    Just adding the time into the expression wouldn’t work, cause I would still have to go over all the layer to copy and past the expression. EG. Layer1 starts 2 seconds earlier than layer2, but layer1 starts 4 seconds earlier than layer3…

    I hope that my explanation is somehow clear to you guys. I find it hard to describe the issue with the right words 😛

    kyle watson replied 5 years, 3 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    January 8, 2013 at 7:56 pm

    Something like this should work:

    L = thisComp.layer(“layer1”);
    L.transform.opacity.valueAtTime(L.inPoint + time – inPoint)

    Dan

  • Stefan Van mourik

    January 8, 2013 at 8:23 pm

    Dan,

    I’m speechless!

    You’re the man. Thanks!!

  • kyle watson

    January 28, 2021 at 4:39 pm

    Also new ish to expressions. This is something that I tend to want to use a lot.

    Say I have 5 duplicated layers of a box scaling from 1-100 over 2 seconds. Each layer’s start point is offset by 20 frames. I would like to set an expression to the scale of 4 of the layers so that I can simply adjust the scale on the root layer and have it effect all.

    So I would like the applied expression to effect each layer from it’s in point. For some reason the above solution keeps breaking for me!

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