Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects How to stop expression with Slider?

  • How to stop expression with Slider?

    Posted by Michael Garske on January 24, 2014 at 9:30 pm

    I’m very new to expressions and am wondering how I might go about integrating a slider to control when an expression stops using the slider’s keyframes.

    I’m using this basic expression for the classic clock hand animation :

    time*360

    Thanks so much for your help!

    Michael Garske replied 12 years, 3 months ago 3 Members · 3 Replies
  • 3 Replies
  • Philip Bowser

    January 24, 2014 at 9:53 pm

    So if you have your “time*360” expression driving a slider control, you want that slider to stop counting up when it reaches a certain frame? And I’m assuming maintaining whatever value it stopped at?

    Or you want it to count up until it reaches a specific value?

    Philip. Bowser

  • Kevin Camp

    January 24, 2014 at 9:57 pm

    i’d try stoping it with a layer marker:

    if (marker.numKeys > 0)
    	if (time > marker.key(1).time)
    		n = marker.key(1).time
    	else
    		n = time
    else
    	n = time
    
    d = 100
    Math.round (n*d)/d

    the expression will use the time at the point of the layer marker as the final/stop position of the hand.

    if you needed to stop and start the hand, to get the most control, instead of linking the expression to time, you could link it to a slider on the same layer…

    n = effect("Slider Control")("Slider")
    d = 100
    Math.round (n*d)/d

    if you add a keyframe to the slider at :00.0 with a value of 0, and then another keyframe at say :10.0 with a value of 10, you’d get the same animation as n = time, but the animation would stop at :10.

    then if you wanted it to start again at :15.0, you’d just add a keyframe at that point (value 10) and then another keyframe later with a value relative to the between the stop and re-start keyframes (in this example 5).

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Michael Garske

    January 24, 2014 at 10:40 pm

    Using the slider control did the trick, I wanted to apply “Animations Patterns” to the slider key frames and this works perfectly for that. Thanks Kevin!

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