Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How to obtain an expression later in time

  • How to obtain an expression later in time

    Posted by Lucia Bastenhof on August 22, 2007 at 11:18 am

    Hi there !

    I’m trying to link the opacity, the scale and the levels of many layers to those of one single layer by an expression, that’s not too difficult :-)(not for the levels), but I’m trying to get the animations of each layer arriving a little later than the previous one.
    That ‘s to say the same animations, but a little later for each layer (something like 10 frames).

    I’m sure there’s a solution, maybe very easy ! But I don’t know the expressions enough at the moment …

    I go on and try, but maybe it’s very easy for you ?

    Thanks ! 🙂

    Lucia Bastenhof replied 18 years, 8 months ago 3 Members · 12 Replies
  • 12 Replies
  • Mike Clasby

    August 22, 2007 at 4:12 pm

    This little expression from Dan should work:

    delay = 10; //number of frames to delay

    d = delay*thisComp.frameDuration*(index – 1);
    thisComp.layer(1).opacity.valueAtTime(time – d)

    It came from here:

    https://www.motionscript.com/mastering-expressions/follow-the-leader.html

    witch is part of his main site, sort of the online Holy Grail of Expressions:

    https://www.motionscript.com/

  • Lucia Bastenhof

    August 22, 2007 at 4:43 pm

    Thanks yikesmikes, I was just looking what I could do with valueAtTime ! 🙂 . I pasted your expression (changing opacity to scale too), but it doesn’t work exactly : the layer appears in fact exactly 2 seconds after the animated layer :
    (with 25 fps 🙂
    the animated layer appears at 03:18
    the linked layer appears at 05:18
    10 frames later, that would be 04:03.

    But the solution is not very far ! 🙂
    I’m searching further. I’ll go to motionscript too. If you have an idea about what’s the wrong piece, it would be great !! 🙂

    Thanks !

  • Dan Ebberts

    August 22, 2007 at 5:11 pm

    It sounds like your linked layer is layer 6. That would give it a delay of 50 frames. For a 10 frame delay, the expression assumes that it would be layer 2. There are, of course, ways to solve the problem – it just depends on what you’re trying to do.

    Dan

  • Lucia Bastenhof

    August 22, 2007 at 6:58 pm

    IT IS the layer 6 !!! 🙂
    I think I begin to understand something… My brain is working, but I think it would work better with your help 🙂
    So, I’ll try to be more accurate :

    I try to animate 8 letters (il ou elle).(they’re normal layers).
    I want to give the feeling that each letter appears like a drop on water.
    I don’t have any recipe. I made a first animation on the first letter, and it seems to be a good direction, but I’m sure I’ll have to make changes later.

    There are 3 layers per letter : beneath the first one (only disappearing after a while), the same letter appears 2 times, like circles on water (mmh…not exactly yet… :-). Those 2 samples are more transparent and are disappearing, they are bigger, and while disappearing, they become always bigger. The colour is changing too, becoming more white.

    What I did on the first letter, after the duplication :
    – On the first layer (say letter 1-a) : animation of Transparency
    – On the second layer (letter 1-b) : 10 frames later, animation of Levels-histogram, of Scale, and of Transparency.
    – On the third layer (letter 1-c) : the same 3 animations, 10 frames more later.
    (These 3 layers have the same entry point. To avoid any mistake during my search, I put a keyframe at the entry on each animation.)

    So, I’d like to obtain the same animation for all the letters ! 🙂
    I think each letter should appear 10 (or less…) frames after the previous one.
    So, I began to try something like that :
    1- Letter 1-a
    2- Letter 1-b
    3- Letter 1-c
    4- Letter 2-a, Transp. linked to Transp. of 1-a
    5- Letter 2-b, each animation (Levels, Scale, Transp.) linked to the same one on 1-b
    6- Letter 2-c, linked to 1-c
    7- Letter 3-a, linked to 1-a
    8- Letter 3-b, linked to 1-b
    9- Letter 3-c, linked to 1-c…

    8*3—> I have 24 layers.
    All the *-a are linked to 1-a, each time 10 frames later.
    All the *-b are linked to 1-b and the *-c to 1-c on the same way.
    (Maybe it’s better to gather the a, the b the c together, but I think it’s a detail)

    I think you understand all the interest of an expression in that case ! 🙂
    I would have to link each layer separately, to change the valueAtTime or the number of frames, but then I could easily make changes (on the animations).

    I hope you read me so far ! 🙂 and I hope you have an idea about the solution.

    Thanks ! 🙂

  • Dan Ebberts

    August 22, 2007 at 8:19 pm

    Try this variation:

    delay = 10; //number of frames to delay

    idx = index%3;
    d = delay*thisComp.frameDuration*(idx – 1);
    thisComp.layer(1).opacity.valueAtTime(time – d)

    Dan

  • Lucia Bastenhof

    August 23, 2007 at 3:55 pm

    Thanks Dan ! 🙂

    It must be the right expression ! I pasted it on Opacity and Scale, on layers 5 & 6 (letter 2, b and c). (changing only opacity to scale and the number of Comp.layer)

    5- Letter 2-b : it works perfectly ! :-). The letter appears 10 frames later.
    6- Letter 2-c : The letter appeared 10 frames before the source layer (1-c).
    I tried to adapt the expression, changing (idx – 1) to (idx), then to (idx + 1).
    With (idx + 1), the letter appears at the right moment ! 🙂

    So, I think you found the right expression ! 🙂 I just have to adapt it.
    To adapt it, could you explain me some terms of the expression ? I did a first adaptation, at random, but I don’t understand exactly what I did…

    I go on testing…

    Thanks ! 🙂

  • Dan Ebberts

    August 23, 2007 at 5:01 pm

    Sorry – I messed it up. That’s what I get for postiing without testing. This should be better and shouldn’t need any adapting (if I’ve understood your requirements).

    delay = 10; //number of frames to delay

    idx = Math.floor((index-1)/3);
    d = delay*thisComp.frameDuration*(idx);
    thisComp.layer(1).opacity.valueAtTime(time – d)

    Dan

  • Lucia Bastenhof

    August 26, 2007 at 6:01 pm

    Thanks Dan ! 🙂 It works perfectly ! 🙂

    (Sorry for this delay, I was too tired those last evenings to go working on AE…)

    It works exactly as I wanted, except for the levels, which seem to accept no expressions (or did I miss anything ?)

    I think I will be able now to make the animation easily. But if you could, I’d like you to explain some keys of the expression. I suppose I just have to change 10 to another number to change the number of frames to delay. And what is the meaning of (index-1)/3) ? I’d like to understand… 🙂

    Great thanks !! 🙂

  • Dan Ebberts

    August 27, 2007 at 3:51 am

    I’m not sure what levels you’re talking about. Sorry if I missed a key point.

    You are correct, you would just change the 10 to change the delay.

    Math.floor((index – 1)/3)

    just groups the layers into groups of 3. The result will be that layers 1 through 3 will be in group 0, layers 4 through 6 will be in group 1, etc. The expression then uses that value to calculate the delay for each layer (the delay for layers 0 through 3 will be zero, for layers 4 through 6 it will be 10 frames, etc.)

    Dan

  • Lucia Bastenhof

    August 27, 2007 at 4:29 pm

    Thanks Dan for all these explanations ! 🙂

    The levels I spoke about is the histogram. To animate the colour of the first letter, I animated the black entry (which is beneath the histogram). This black entry can’t be animated directly : I have to animate the “watch” of all the histogram, but this watch seems to be unable to support the expressions… Alt+Click on the watch has no effect.

    Thanks ! 🙂

Page 1 of 2

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