ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Multiple Expressions on a single Parameter

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
George Henderson
Multiple Expressions on a single Parameter
on Aug 9, 2019 at 10:17:14 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];


Return to posts index

Dan Ebberts
Re: Multiple Expressions on a single Parameter
on Aug 9, 2019 at 10:23:42 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



Return to posts index

George Henderson
Re: Multiple Expressions on a single Parameter
on Aug 9, 2019 at 10:58:05 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!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]