Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Simple Opacity Expression ?help?

  • Simple Opacity Expression ?help?

    Posted by Robin Hamilton on August 15, 2007 at 3:58 pm

    I tried searching for this, but can’t quite figure out what to call it 🙂

    Basically I want the opacity of one layer to be linked with the opacity of another layer, but in a negative way. I am using hold keyframes to turn a layer’s opacity from 0% to 100%. I would like another layer to do the opposite… So all I have to do throughout the animation is set hold keyframes for one layer, and the other layer’s opacity will go to 100% when the keyframed layer is set to 0%.

    I know this should be a simple expression, but it seems the programming side of my brain doesn’t work too well.

    Thanks!

    Mark Likosky replied 14 years, 4 months ago 5 Members · 11 Replies
  • 11 Replies
  • Lord Scales

    August 15, 2007 at 4:54 pm

    Try this:

    layerOp = thisComp.layer (“Layer 1”).opacity //the other layer

    linear (layerOp, 0, 100, 100, 0) //as the opacity goes from 0 to 100, the value goes from 100 to 0

  • Robin Hamilton

    August 15, 2007 at 4:58 pm

    That works perfectly. I was waaaaay off on the wrong path. I would never have figured that out.

    Thanks a lot.

  • Dan Ebberts

    August 15, 2007 at 5:00 pm

    This is a little simpler:

    100 – thisComp.layer(“Layer 1”).transform.opacity

    Dan

  • Robin Hamilton

    August 15, 2007 at 7:21 pm

    Thanks Dan, that works great as well.

  • Gary Mayes

    March 14, 2010 at 12:11 pm

    Hi guys

    I’m not a natural when it comes to expressions, so hence me asking this – Why oh why does the 100 – at the front of ‘100 – thisComp.layer(“Layer 1”).transform.opacity’ make this happen? Finding this was so helpful, as it meant that I didn’t need to keyframe two layers to replace one element with another.

    I just want to understand what’s going on in such a simple expression. Help me learn – please!

    Thanks

    Gary

    Motion graphics designer and filmmaker

  • Dan Ebberts

    March 14, 2010 at 11:00 pm

    When Layer 1’s opacity is 100, this layer’s (the layer with the expression) opacity is 100 – 100, which is zero. When Layer 1’s opacity is 50, this layer’s opacity is 100 – 50, which is 50. So the “100 – ” is what establishes the inverse relationship between the opacities of the two layers.

    Dan

  • Gary Mayes

    March 15, 2010 at 9:57 am

    Thanks Dan, that makes perfect sense!

    Gary

  • Mark Likosky

    March 16, 2012 at 7:25 pm

    I’m trying to create a preset or expression to fade out the last 7 frames. Having a hard time figuring out to make it happen.

    thought this was a similar thread on how to do that

  • Dan Ebberts

    March 16, 2012 at 7:34 pm

    Try this:

    fadeDur = framesToTime(7);
    ease(time,outPoint-fadeDur,outPoint,value,0)

    Dan

  • Mark Likosky

    March 16, 2012 at 8:13 pm

    Dan,

    That seems to work nicely!

    I’m just getting the hang of expressions. How do I save that as a preset?

    Thx!

    fadeDur = framesToTime(7);
    ease(time,outPoint-fadeDur,outPoint,value,0)

Page 1 of 2

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