-
Camera movement controlled by length of word
Hello all,
I’m pretty new to expressions within AE, and I’m attempting to control the movement of the comp camera based on the length of words in a pre-comp.
What I really need is an expression that will play a given number of frames at a layer marker, based on the length of string 1 (“text”), and will then move to the next marker and play a given number of frames based on the length of string 2 (“goes”) etc.
I’ve attempted to use this code…and it almost worked, but also really didn’t, and only used one of the layers of text.
Any help would be greatly appreciated.
n = marker.numKeys;
l = comp("Text for layer").layer("text").text.sourceText.length;
if (n > 0){
f = timeToFrames(time/(l*10));
idx = Math.min(f + 1, n);
marker.key(idx).time
}else{
value
}