Creative Communities of the World Forums

The peer to peer support community for media production professionals.

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 pm

    Hi,

    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 pm

    Just 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 pm

    Thnx 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 pm

    More 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 pm

    Hi 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 = 100

    s1 = 150
    s2 = 50

    s1 = 200
    s2 = 0

    etc..

  • Dan Ebberts

    March 25, 2009 at 5:42 pm

    Try this:

    s = 200 – thisComp.layer(“1st solid”).transform.scale[0];
    [s,s]

    Dan

  • Marten Kopp

    March 25, 2009 at 7:47 pm

    Thnx man. That worked out great!

  • Gustavo Saliola

    December 27, 2012 at 4:28 pm

    Hi 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 pm

    Assuming 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

  • Gustavo Saliola

    December 27, 2012 at 5:33 pm

    Thanks Dan! You Math Monster!

  • Pedro De jesus

    June 7, 2016 at 8:47 pm

    Hey 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!

Page 1 of 2

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