Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects expression controlling an effect parameter

  • expression controlling an effect parameter

    Posted by Death_or_glory on December 20, 2006 at 8:20 pm

    I’d like to write an expression that uses a layer’s z depth to control an effect such as a levels or contrast adjust.
    For example, when Layer 1 is at 512,620,0 gamma is 1.0. When Layer 1 is at 512,620,1000
    gamma goes to 7.0.

    I’m new to expressions, thanks for your help!

    Death_or_glory replied 19 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Aharon Rabinowitz

    December 20, 2006 at 8:46 pm

    This won’t work for Levels gama as its not keyframable on it’s own, but it will work with contrast.

    Place this expression in the contrast property for the Brightness and contrast effect:

    x=transform.position[2];
    linear(x,0,1000,0,-100)

    THe first line creates a variable that says: The term “x” means whatever value is listed in the Z position property.

    The next line says, take that value which will vary between 0 and 1000, and convert it to a value that fits within the range 0 to -100.

    As a result, as the layer moves from Z=0 to Z=1000 it will go from default contrast (0) to no contrast (-100).

    You can change those parameters (and you’ll probably want to) especially if you want the layer to move back further before completely losing contrast. So set the 3rd parameter (the 1000 in the linear function above) to however far back you want it to be before it loses all contrast.

    FYI – I have a tutorial coming out soon that expalins the whole linear function.

    Hope this helps.

    Aharon

    PS: Dan Ebberts – thanks for all of your help on educating me with regard to expressions.

    —————————————-
    Aharon Rabinowitz
    aharon(AT)yahoo(DOT)com
    http://www.allbetsareoff.com
    —————————————-
    Creative Cow Master Series DVD
    particleIllusion Fusion Volume 1
    available @ http://www.pIllusionFusion.com

  • Death_or_glory

    December 20, 2006 at 8:55 pm

    Perfect, thanks!

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