Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Increase position with comp markers

  • Increase position with comp markers

    Posted by Hyun Myung Kim on April 18, 2022 at 12:05 pm

    Hello

    I got the formula I wanted. (Thank you for Dan)

    Only one frame of position movement.

    I want to move my position to an animation for a few seconds

    I can’t find the answer, so I’m asking you a question

    —————————————————-

    sy = effect(“Slider Control”)(“Slider”);

    m = marker;

    y = 0;

    if (m.numKeys > 0){

    n = m.nearestKey(time).index;

    if (time < m.key(n).time) n–;

    for (i = 1; i <= n; i++){

    y += sy.valueAtTime(m.key(i).time);

    }

    }

    value + [0,y]

    —————————————————-

    My English is poor Please understand.

    Hyun Myung Kim replied 4 years, 5 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    April 18, 2022 at 1:08 pm

    Like this maybe:

    easeTime = 1;

    sy = effect("Slider Control")("Slider");

    m = marker;

    y = 0;

    if (m.numKeys > 0){

    n = m.nearestKey(time).index;

    if (time < m.key(n).time) n--;

    for (i = 1; i <= n-1; i++){

    y += sy.valueAtTime(m.key(i).time);

    }

    if (n > 0){

    t = time - m.key(n).time;

    y += ease(t,0,easeTime,0,sy.valueAtTime(m.key(n).time));

    }

    }

    value + [0,y]

  • Hyun Myung Kim

    April 18, 2022 at 2:52 pm

    That’s exactly what I want
    Thanks a lot.

    Now, the animation starts with the marker. What should I modify to make the animation end with the marker?

  • Dan Ebberts

    April 18, 2022 at 6:38 pm

    Like this:

    easeTime = 1;

    sy = effect("Slider Control")("Slider");

    m = marker;

    y = 0;

    if (m.numKeys > 0){

    n = m.nearestKey(time).index;

    if (time > m.key(n).time) n++;

    for (i = 1; i <= n-1; i++){

    y += sy.valueAtTime(m.key(i).time);

    }

    if (n <= m.numKeys){

    t = m.key(n).time - time;

    y += ease(t,0,easeTime,sy.valueAtTime(m.key(n).time),0);

    }

    }

    value + [0,y]

  • Hyun Myung Kim

    April 18, 2022 at 7:45 pm

    It’s perfect.
    Thank you so much that I can’t express it in words

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