Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Adding Time offset to Marker expression

  • Adding Time offset to Marker expression

    Posted by Mac Lad on May 23, 2021 at 2:35 pm

    Hello guys,

    I have below expression on time-remap property which triggers animation on the markers set on Action layer.

    Is it possible to add certain frames of pre-roll to this expression so if the maker is set at 1 sec the transition start at 0.5 sec.

    I have added n=1 so that it skips first marker as it does not require transition.

    Thank you!

    m = thisComp.layer("Action").marker;
    n = 1;
    if (m.numKeys > 1){
    n = m.nearestKey(time).index;
    if (m.key(n).time > time) n--;
    }
    if (n > 1){
    t = m.key(n).time;
    time - t ;
    }else
    0
    Mac Lad replied 5 years, 2 months ago 2 Members · 4 Replies
  • 4 Replies
  • Andrei Popa

    May 24, 2021 at 7:10 am

    I guess what you are looking for is changing t = m.key(n).time; to t = m.key(n).time-0.5;.

  • Mac Lad

    May 24, 2021 at 11:31 am

    hey, thanks for reply but I have already tried it and it does not works ..it does slides the transition .5 earlier but trims the start of the transition by .5

  • Mac Lad

    May 24, 2021 at 11:57 am

    In case if it helps here is ae file that can help to understand my problem

  • Mac Lad

    May 25, 2021 at 7:58 am

    Solution;

    Removing if (m.key(n).time > time) n–; works for me

    Final working expression

    m = thisComp.layer("Action").marker;
    n = 1;
    if (m.numKeys > 1){
    n = m.nearestKey(time).index;
    }
    if (n > 1){
    t = m.key(n).time-.5;
    time - t ;
    }else
    0

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