Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Can anyone fix this expression for me?

  • Can anyone fix this expression for me?

    Posted by Matt Volp on May 8, 2017 at 9:22 pm

    I’m trying to apply this expression to the position property of a Transform effect applied to a layer.

    I only want my expression to affect the X value, and not the Y.

    I have to apply it to a Transform effect rather than the native position of the layer as I want to be able to switch the animation on and off with the effect opacity in the compositing options.

    Where am I going wrong?

    d=thisComp.layer(“CONTROL”).effect(“Animation”)(“Duration”);
    xP=thisComp.layer(“CONTROL”).effect(“Text”)(“X Position”);
    yP=thisComp.layer(“CONTROL”).effect(“Text”)(“Y Position”);

    x=if (time < d) easeOut(time,inPoint,inPoint+d,-542,xP) else easeIn(time,outPoint-d,outPoint,xP,-542) [x[0],value[1]]

    Matt Volp replied 9 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 8, 2017 at 10:36 pm

    I haven’t tested this, but it should be close:

    d=thisComp.layer(“CONTROL”).effect(“Animation”)(“Duration”);
    xP=thisComp.layer(“CONTROL”).effect(“Text”)(“X Position”);
    yP=thisComp.layer(“CONTROL”).effect(“Text”)(“Y Position”);

    if (time < d)
    x = easeOut(time,inPoint,inPoint+d,-542,xP)
    else
    x = easeIn(time,outPoint-d,outPoint,xP,-542);

    [x[0],value[1]]

    Dan

  • Matt Volp

    May 9, 2017 at 12:02 pm

    Thanks Dan, this did the trick!

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