Creative COW SIGN IN & SETTINGS :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: ForumAE BasicsAE ExpressionsTutorialsArticlesPodcastsMotion GraphicsTrainingCinema 4D

Exponential slider query...

Cow Forums : Adobe After Effects Expressions
Exponential slider query...
by Danny Parsons on May 4, 2008 at 9:28:01 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


Respond to this post     Return to posts index

Re: Exponential slider query...
by Dan Ebberts on May 4, 2008 at 11:00:23 pm

Like this, I think:

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


Dan



Respond to this post     Return to posts index

Re: Exponential slider query...
by Danny Parsons on May 5, 2008 at 12:12:58 pm

Thanks Dan,

That's done the trick perfectly.

DP



Respond to this post     Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSLIBRARYPODCASTSBLOGSMAGAZINESERVICESNEWSLETTERSNEWSSTOREEVENTS

© CreativeCOW.net All rights are reserved.

[Top]