Activity › Forums › Adobe After Effects Expressions › how to get the opposite?
-
how to get the opposite?
Posted by Marten Kopp on March 25, 2009 at 2:59 pmHi,
I got a question. Propeply very simple but I just dont understand a thing. How do you get some layer property to get the opposite value of another? e.g:
the scale of my solid is 100% and the 2nd solid is -100%. how do I get the scale of my 1st solid to get to -100% if I keyframe the other to 100%??
Sounds easy. Sorry for my poor english but I hope you guys understand my question.
cheers.
Pedro De jesus replied 9 years, 11 months ago 4 Members · 12 Replies -
12 Replies
-
Dan Ebberts
March 25, 2009 at 4:07 pmJust apply a Scale expression like this to the 2nd solid:
-thisComp.layer(“1st solid name”).transform.scale
Dan
-
Marten Kopp
March 25, 2009 at 4:57 pmThnx for your reply. But that wasnt exactly what i ment.
What I’d like to know is this:
What expression is needed to let one layer shrink the size the other layer grow?
-
Dan Ebberts
March 25, 2009 at 5:06 pmMore like this then, maybe:
s = thisComp.layer(“1st solid name”).transform.scale;
[100-s[0],100-s[1]]Dan
-
Marten Kopp
March 25, 2009 at 5:33 pmHi dan,
Thnx for the help. But it still doesnt do what Im looking for. Solid 2 scale’s along with Solid 1 but it needs to go the oposit direction, like this:
s1 = 100
s2 = 100s1 = 150
s2 = 50s1 = 200
s2 = 0etc..
-
Dan Ebberts
March 25, 2009 at 5:42 pmTry this:
s = 200 – thisComp.layer(“1st solid”).transform.scale[0];
[s,s]Dan
-
Gustavo Saliola
December 27, 2012 at 4:28 pmHi Dan, i’m just looking for something similar, but in this case, with “y” position, to animate two eye lids in a bug, in opposite positions with an Expression Control.
Thanks in advance.
Gustavo.
-
Dan Ebberts
December 27, 2012 at 4:56 pmAssuming you have a Slider Control on a layer named “controls”, it would look like this for the upper eyelid:
s = thisComp.layer(“controls”).effect(“Slider Control”)(“Slider”);
value – [0,s]and this for the lower:
s = thisComp.layer(“controls”).effect(“Slider Control”)(“Slider”);
value + [0,s]Dan
-
Pedro De jesus
June 7, 2016 at 8:47 pmHey Dan,
Is there a command name we can use in expressions to tell it to do the opposite of what the original layer its pick-whipped to? Meaning, if LAYER 1 is moving up, and I want LAYER 2 to do the direct opposite (go down at the same speed while being connected to LAYER 1 via an expression), what command name should I use for that?
This is just one example, but essentially I’m looking to be able to apply the opposite/inverse expression command to many other situations. Thanks!
Reply to this Discussion! Login or Sign Up