Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions set expression on one layer and have subsequent layers follow same behavior

  • Dan Ebberts

    August 5, 2010 at 7:22 pm

    Play around with this:

    strtTime = 1;
    zDist = 500;
    moveDur = .75;
    delay = 1;

    t1 = strtTime + (index-1)*delay;
    t2 = t1 + moveDur;
    if (time < t2) value - ease(time,t1,t2,[0,0,0],[0,0,zDist]) else value - ease(time,t2,t2+moveDur,[0,0,zDist],[0,0,0]); Dan

  • Zach Meissner

    August 5, 2010 at 8:03 pm

    Thanks Dan, i applied it to the Position attribute, but just kept getting an error. I have keyframed the z postion, 0 at both ends and -145 in the middle for the scale effect of coming forward and back.

    here is a screenshot:

    http://www.lab316.com

  • Dan Ebberts

    August 5, 2010 at 8:19 pm

    Ah. It looks like the “if” statement got messed up in the translation. It’s supposed to be:

    if (time < t2)

    Also, it’s set up to generate the z animation without any keyframes. It will just sequence one layer after another, starting at whatever you have strtTime set to.

    If you want to keyframe the first layer (let’s say it’s named “leader”) then you could use an expression like this on the others (which need to be below “leader” in the layer stack):

    delay = 1;
    L = thisComp.layer(“leader”);
    z = L.transform.position.valueAtTime(time – (index – L.index))[2];
    [value[0],value[1],z]

    Dan

  • Zach Meissner

    August 5, 2010 at 8:27 pm

    Great!

    No i’m trying to take it one step further and make the individual attributes on their own sliders so that I only need to adjust one setting for the 25 or so panels that I will have.

    I created a null object with a expression slider, then selected zDist in the expression of the first panel. When I did this I got an error. Is this the best way to set up the attributes so they can be changes instead of having to go into each individual expression and having to change it?

    After Effects warning: Class â

  • Dan Ebberts

    August 5, 2010 at 8:27 pm

    Also, make sure you copy the code from the web site, not the email. The email appears to be getting messed up.

    Dan

  • Zach Meissner

    August 5, 2010 at 8:36 pm

    Yep, i’m copying the code from the forum itself.

    Now i’m trying to take it one step further and make the individual attributes on their own sliders so that I only need to adjust one setting for the 25 or so panels that I will have.

    I created a null object with a expression slider, then selected zDist in the expression of the first panel. When I did this I got an error. Is this the best way to set up the attributes so they can be changes instead of having to go into each individual expression and having to change it?

    http://www.lab316.com

  • Dan Ebberts

    August 5, 2010 at 8:37 pm

    Yes. The pick whip should take care of the syntax for you. If you can’t get it to work, post a screen shot of the broken expression and the error message.

    Dan

  • Zach Meissner

    August 5, 2010 at 8:40 pm

    Sorry, looks like that last message got sent twice. Here is the screenshot:

    http://www.lab316.com

  • Dan Ebberts

    August 5, 2010 at 8:50 pm

    OK – you still need to define a local variable named “zDist”. Your second line should look like this:

    zDist = thisComp.layer(“Null 1”).effect(“zDist”)(“Slider”);

    When you used the pick whip it looks like you replaced the whole second line, but really you needed to just replace the value and leave the “zDsit =” part.

    Dan

  • Zach Meissner

    August 5, 2010 at 8:55 pm

    ahhh alas! Thanks again for lending your geniusness Dan!

    http://www.lab316.com

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