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 from 2 different layers

  • Control 2 keyframes from 2 different layers

    Posted by Mat Chevitz on September 3, 2010 at 11:41 am

    Hey,

    Here is my case :

    I would like to control the value of 2 different keyframes, from 2 different layers. Is it possible ?

    For example, i would like the 2 keyframes on the left to be the same value which i could control.

    Thx
    Brice

    Dan Ebberts replied 15 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    September 3, 2010 at 3:49 pm

    Assuming the keyframes are linear, you could replace the value of the first one of each pair by linking it to a slider on null layer (named “Controls” in this example) with an expression like this:

    v1 = thisComp.layer(“Controls”).effect(“Slider Control”)(“Slider”);
    v2 = key(2).value;
    t1 = key(1).time;
    t2 = key(2).time;
    linear(time,t1,t2,v1,v2)

    This would work for single-dimensional properties like rotation or opacity. For position, I guess you’d use a point control instead of a slider.

    Dan

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