AE "Captions"
Here is way, via expressions, we can take a paragraph of text in the AE Type tool and split it into sentences. If you use the expression slider included in the preset you can simply "slide" through the sentences. This is good way to make down and dirty graphics for translation work or perhaps for use with captioning.
A couple shortcomings with this are the following:
1. Your text cannot contain any quotes. If you need quotes, use a find/replace and switch the " character to a \ in any word processor program.
2. A fundamental shortcoming of Source Text expressions is that they do not have any way to reference the effective length of a line of type (Adobe has repeatedly heard me whine about this). If a line of type is larger than your composition width, it will spill off the side of the screen. To attempt to fix this, I made a "line break" function, which is simply a number slider that defines the point at which the sentence drops to the next line. It's not aware of word separation at this point. But, it is something that you can keyframe.
DOWNLOAD THE PROJECT HERE.
Also, here is the code*:
type = "Many. Sentences. Go. Here.";
sentences = type.split(".");
n = Math.floor(effect("Lines")("Slider"));
if (n>=sentences.length){n=sentences.length-1}
if (n<=0){n=1}
lineBreak = effect("LineBreak")("Slider");
line = sentences[n];
if(line.length > lineBreak){
"" + line.slice(1, lineBreak+1) + "\r" + line.slice(lineBreak +1, line.length);
}else{
"\r" + line + ".";
}
*this code assumes you have two expression sliders called "Lines" and "Linebreak" posted by Harry @ 9/13/2006 11:59:00 AM |












0 Comments:
Post a Comment
Links to this post:
Create a Link