ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: expression to show comments and duration between markers :)

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Respond to this post   •   Return to posts index   •   Read entire thread


Dan EbbertsRe: expression to show comments and duration between markers :)
by on May 25, 2012 at 4:26:22 pm

I think you're after something like this:



m = thisLayer.marker; //layer where the markers is
n = 0;
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (m.key(n).time > time) n--;
if (n == m.numKeys){ // after last marker
t = thisComp.duration - m.key(n).time;
c = m.key(n).comment;
}else if (n == 0){ // before first marker
t = m.key(1).time;
c = "";
}else{ //between two markers
t = m.key(n+1).time - m.key(n).time;
c = m.key(n).comment;
}
}else{ // no markers
t = thisComp.duration;
c = "";
}

c + "r" + timeToTimecode(t)



(note that the "r" in the last line should be "(backslash)r"


Dan



Posts IndexRead Thread 


Current Message Thread:





© 2016 CreativeCOW.net All Rights Reserved
[TOP]