Forums › Adobe After Effects Expressions › Shot numbers: text value advances at layer markers
Shot numbers: text value advances at layer markers
Tom Ma
October 4, 2012 at 8:25 pmI am attempting to automate making shot numbers on a layer of video.
The single layer of video has a marker at each edit (within the picture of the video)I would like to make a text layer with a number.
Then make an expression that advances the number by an increment of 10 at each layer marker on the video layer. (I could also place these markers on the text layer to make it easier)
So it would go: 010, 020, 030, 040 etc…This would be very handy in automating shot numbers for reference video.
thanks in advance.
Dan Ebberts
October 4, 2012 at 8:58 pmLike this, I would think:
m = thisComp.layer("video").marker;
n = 0;
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (m.key(n).time > time) n--;
}
s = "" + n*10;
while (s.length < 3) s = "0" + s;
s
Dan
Tom Ma
October 5, 2012 at 12:02 amThat did it.
Dan.
Thank you once again!Tom Ma
October 5, 2012 at 1:30 amif I may humbly ask an extra:
an expression for type layer that will return the text in the label of the marker?
thanks!
Dan Ebberts
October 5, 2012 at 1:56 am
m = thisComp.layer("video").marker;
n = 0;
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (m.key(n).time > time) n--;
}
(n > 0) ? m.key(n).comment : ""
Dan
Tom Ma
October 5, 2012 at 2:50 amnice.. thx.
Log in to reply.