Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Exponential slider query…

  • Exponential slider query…

    Posted by Danny Parsons on May 4, 2008 at 9:28 pm

    Hi there – ‘May the fourth’ be with you all…

    I’m having some trouble figuring out how to get a slider to control an effects property in the precise way I want it to. I’d initially thought I could just use the linear() function, but clearly I hadn’t thought things through properly…

    Describing the actual scenario would probably be unnecessarily long-winded to go into, so I’ve just come up with an analogous hypothetical situation, which should help explain more simply the basic principle that eludes me…

    Let’s say that I want to link a layer’s opacity value to a null’s slider control and have it translate the input in the following way:

    When the slider is set at zero, opacity = 50
    If we turn the slider up to 1.0, opacity = (50* 1.05)
    And then if we turn it up another notch to 2.0, opacity = (50* 1.05)*1.05
    … And so on, multiplying the previous value by the same amount each time. It also needs to work in the opposite direction – if the slider is set to a negative value, it should divide the previous value by the same amount each time, so if the slider = -1.0, opacity = (50/ 1.05).

    Thanks in advance,

    DP

    Danny Parsons replied 18 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 4, 2008 at 11:00 pm

    Like this, I think:

    slider = effect(“Slider Control”)(“Slider”) ;
    50*Math.pow(1.05,slider)

    Dan

  • Danny Parsons

    May 5, 2008 at 12:12 pm

    Thanks Dan,

    That’s done the trick perfectly.

    DP

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