Jonathan Wendt
Forum Replies Created
-
Thank you so much! I knew it was something simple along those lines. I swear I thought I tried every permutation of that, but I must’ve just missed the right one. This was exactly what I needed.
-
Jonathan Wendt
November 3, 2015 at 9:31 pm in reply to: Animating text on then off the exact same way.There is a typewriter preset in after effects. You can drag that onto your text layer twice, and then the second time set it to subtract instead of add.
-
Oh man, thank you. I knew that was the problem somehow but just wasn’t seeing it for staring at it so long. By any chance do you know how to apply vertical center alignment to the layer? I know I can do t.justification = ParagraphJustification.CENTER_JUSTIFY and it centers it horizontally, now I’d like to do the same on the vertical axis. The button on the align panel works perfectly, but I don’t see how to call it in the cs6 scripting guide.
-
Walter, once again thank you for your reply! Your suggestion to do it as point text and then scaling it makes total sense to me. But being new to scripting I’m making a mess out of it. I’m able to create the text layer, read it’s width and compare it to the composition.
//
// createTextLayersFromFile.jsx
////
// This script reads a user specified text file and
// creates a text layer for each line of text
//{
// create undo group
app.beginUndoGroup("Create Text Layers From File");
// Prompt user to select text file
var myFile = File.openDialog("Please select input text file.");
if (myFile != null){// open file
var fileOK = myFile.open("r");
if (fileOK){// read text lines and create text layer for each
// until end-of-file is reachedvar myComp = app.project.activeItem;
var text;
while (!myFile.eof){
text = myFile.readln();
compW = myComp.width
compH = myComp.height
if (text == "") text = "\r" ;
myTLayer = myComp.layers.addText(text);
p =myTLayer.text.sourceText;
t = p.value;
t.fontSize = 79
p.setValue(t);
var my2Layer = app.project.activeItem.layer(text);
var r = my2Layer.sourceRectAtTime(0, false);
while (r.width >= compW){
t.fontSize = t.fontSize - 1;
p.setValue(t);
alert(r.width)
}
}// close the file before exiting
myFile.close();
}else{
alert("File open failed!");
}}else{
alert("No text file selected.");
}app.endUndoGroup();
}So r.width represents the width of the text layer, and compW is what it is being compared to. However in the statement that I made, r.width never seems to reflect the change in size after it goes through each time. So it reduces the font down to 0 and errors out. I’m sure it’s something pretty simple, but I’ve been banging my head against the wall all day. Thanks again in advance.
-
Thank you for your reply, Walter. I’m not sure exactly how to apply your response to my scenario though. I already know the width of the text layer, because I’m creating it from the width of the composition, if you see in the code. And also, scripts do have the ability to set the text size, but I don’t know how to implement the next step where it knows how to dynamically find the right size for the text supplied to fit within the box without wrapping to a second line. If you check out the code below you can see an example of it being able to set lots of properties on the text.
//
// This script reads a user specified text file and
// creates a text layer for each line of text
//{
// create undo group
app.beginUndoGroup("Create Text Layers From File");
function setTextSpec(){
t.resetCharStyle();
t.resetParagraphStyle();
t.fontSize = 25;
t.font = "Helvetica";
t.text = text;
t.justification = ParagraphJustification.CENTER_JUSTIFY;
};// Prompt user to select text file
var myFile = File.openDialog("Please select input text file.");
if (myFile != null){// open file
var fileOK = myFile.open("r");
if (fileOK){// read text lines and create text layer for each
// until end-of-file is reachedvar myComp = app.project.activeItem;
var presetPath = "/Applications/Adobe After Effects CS6/Presets/Text/Animate In/Slow Fade On.ffx";
var text;
while (!myFile.eof){
text = myFile.readln();
compW = myComp.width
compH = myComp.height
if (text == "") text = "\r" ;
layer = myComp.layers.addBoxText([compW, compH], text);
p =layer.text.sourceText;
t = p.value;
setTextSpec();
p.setValue(t);}
// close the file before exiting
myFile.close();
}else{
alert("File open failed!");
}}else{
alert("No text file selected.");
}app.endUndoGroup();
} -
Jonathan Wendt
November 2, 2015 at 9:42 pm in reply to: After Effects Export to SWF cutting off earlyI’ve also had this problem for a very long time. Where I have text layers in 3 compositions, and then the 3 compositions are all in a final master composition. Exporting that as swf always gets cut off, but if I render it out to mov, open a new project with a composition of the same size and import the mov, it will then render the swf out with no problems.
-
Jonathan Wendt
October 28, 2013 at 10:49 pm in reply to: Animation engine overrides particle count in Element 3D?I was told on the video copilot forums that it is impossible. 🙁