Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Text and Markers expression issue

  • Text and Markers expression issue

    Posted by Levi George on January 9, 2014 at 6:11 am

    Hi!

    So I’m working on an animatic template where a text asset can read into the markers on a comp and display the shot number. I’m using Markers at the start and end of each shot, where each cut is. It means I can drag these markers around and the label will update automatically. I’ll eventually expand this for frames and shot length etc.

    I put some code in a text object hoping the text would display the correct shot number.
    but as soon as it moves onto the second Marker it just reads

    [object layer]

    My code is below.

    Thanks for your help in advance.

    for (
    n=1 ;
    time>=thisComp.marker.key(n).time && time<thisComp.marker.key(n+1).time ;
    n++)
    {value = n} ;

    Levi George replied 12 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 9, 2014 at 6:23 am

    It should be close to this:


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

    Dan

  • Levi George

    January 12, 2014 at 3:06 am

    It was exactly that! Thank you very much!

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