Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Control 2 Keyframes values with a slider

  • Control 2 Keyframes values with a slider

    Posted by Sandro Maia on November 2, 2023 at 11:38 pm

    Hi.

    I usually use this expression to control the second keyframe with a slider (works well when i just have 2 keyframes), but what if i have 4 keyframes, and i want to control the second and the third keyframes with the same slider? It’s possible to adapt this expression? The first and fourth keyframe should keep their defined position.


    prop = thisProperty

    firstKey = prop.key(1).time;

    lastKey = prop.key(2).time;

    distanceTotal = prop.valueAtTime(lastKey) - prop.valueAtTime(firstKey);

    distanceCurrent = prop.valueAtTime(lastKey) - prop.valueAtTime(time);

    percentage = 1 - distanceCurrent/distanceTotal;

    offset = effect("SLIDER")("Slider")

    value + offset*percentage;


    Sandro Maia replied 6 months, 3 weeks ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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