Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Multiple Expressions on a single Parameter

  • Multiple Expressions on a single Parameter

    Posted by George Henderson on August 9, 2019 at 10:17 pm

    Hi there,
    I’m trying to have two animated controllers control the position of an object. I was able to get this to work by linking ‘CTRL 1’ to the position attribute and the ‘CTRL 2’ to the position attribute of an ‘transform’ effect that was added on top. I figured there should be a more efficient way of doing this through proper expressions.
    At the moment, this is what my expression reads:

    thisComp.layer(“CTRL 1”).transform.position[0];
    thisComp.layer(“CTRL 2”).transform.position[0];

    The object completely ignores ‘CTRL 1’, but it does react to ‘CTRL 2’ which is understandable. Is there a way to combine the two so that the object reacts to both controllers through expressions?

    Any help would be greatly appreciated.

    FYI – Sample file included: https://gofile.io/?c=8Eg7eW

    thisComp.layer("CTRL 1").transform.position[0];
    thisComp.layer("CTRL 2").transform.position[0];

    George Henderson replied 6 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 9, 2019 at 10:23 pm

    I’m not sure this is what you’re after, but you could add them:

    x1 = thisComp.layer(“CTRL 1”).transform.position[0];
    x2 = thisComp.layer(“CTRL 2”).transform.position[0];
    x1 + x2

    Dan

  • George Henderson

    August 9, 2019 at 10:58 pm

    Hi Dan,
    That did it! The object jumped ahead due to the addition, but adding a ‘-value’ at the end got it back to where it was and now it reacts to both controllers.

    Thank you sir!

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