Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions set slider number to layer marker

  • set slider number to layer marker

    Posted by Ehsan Adham on July 6, 2020 at 2:22 pm

    Hi Every one

    I just want my slider number to be changed along with the layer marker. Such as: 1.2.3.4 …

    i dont need this: marker.nearestKey(time).index

    Stepan Butusov replied 6 years ago 3 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    July 6, 2020 at 3:36 pm

    Like this maybe:


    n = 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (time < marker.key(n).time) n--;
    }
    n

    Dan

  • Ehsan Adham

    July 7, 2020 at 1:48 am

    YeeeeeeeS

    Tanks Dan

  • Stepan Butusov

    August 11, 2020 at 7:32 am

    Hello Dan, This is exactly what I was looking for, Can we add Marker comment parameter to the expression? I want to change the slider number based on the value at current Marker comment. Suppose the current Marker value is 2 I want slider to switch 2 and so on.

    Thanks and Regards!

  • Dan Ebberts

    August 11, 2020 at 9:05 am

    Try this:


    n = 0;
    val = 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (time < marker.key(n).time) n--;
    }
    if (n > 0){
    val = parseInt(marker.key(n).comment,10);
    val = isNaN(val) ? 0 : val;
    }
    val

    Dan

  • Stepan Butusov

    August 11, 2020 at 10:19 am

    Thanks Dan! Works Perfectly.

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