Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Linking a slider control to “percentage of completion”

  • Linking a slider control to “percentage of completion”

    Posted by Josh Kurz on June 6, 2009 at 12:35 am

    I’m setting up a comp that has a layer that will be doing a series of moves, rotations, and effects. For example, the layer moves from the bottom of the screen to the middle, then rotates along the z axis, moves again, and then gaussian blurs (in that order). I’d like to be able to adjust the timing of this sequence of events by using a slider control that would represent the “percentage of completion” as it goes from 0 to 100.

    I’d like to avoid Time Remapping because I’ll have a number of layers all dong the exact same sequence of events but each of the stages will probably have different timings. And it would be nice to just have one controller. Also, there are 3D moves involved so precomping the layer, as far as I can tell, would require duplicating and syncing up the camera for each precomp which gets messy.

    Is such a thing possible?

    Thanks in advance for the help.

    -Josh

    Dan Ebberts replied 17 years, 3 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    June 6, 2009 at 1:44 am

    Let’s say the entire animation lasts 10 seconds. You could add a slider control to a layer named “timing control”, then apply this expression to each animated property:

    pct = thisComp.layer(“timing control”).effect(“Slider Control”)(“Slider”);
    nominalDur = 10; // duration of animation
    valueAtTime(nominalDur*pct/100)

    You’d have to modify the expression for layers in other comps, but you get the idea.

    Dan

  • Josh Kurz

    June 6, 2009 at 10:53 pm

    Thanks for the quick response! I’ll try that.
    And just to confirm that I am understanding the code:
    valueAtTime(nominalDur*pct/100) means use the value found at the time given in the parenthesis. Is that right?

    Thanks for your help again.

    -Josh

  • Dan Ebberts

    June 7, 2009 at 5:11 am

    Yes, that’s correct.

    Dan

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