Black box under subtitle

What type of scripts do you need?

Moderator: byronnash

Post Reply
Skydance
Posts: 2
Joined: June 5th, 2005, 10:23 am
Location: Poland
Contact:

I'm changing the subtitles in a movie from Polish to English. The white letters often get lost when there is a white spot in the background. I'm going through each frame and adding a black box under the type and this is getting really boring. I'm using the text toll in AE. Could someone please help by writing a script that would do this for me? :)
Mabe there is another way and I don't know about it yet? Thanks for your time!
User avatar
Atomic
Posts: 157
Joined: April 30th, 2007, 5:55 am
Location: United States, Ohio

You could just add a drop shadow and blur it out quite a bit. Set its opacity to near 100% or whatever looks good.

If you are running CS3, you could use the new sample image function to detect the white space and adjust the drop shadow opacity automatically.
"Up And Atom

No...No

Up And At Them!"
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

Here's a script I wrote quickly for a very similar task. The script is not really optimized at the moment as it scans every frame and sets keyframes at every frame, but it works. When I have some more time, I'll optimize it to only set keyframes where there's other keyframes.

-Lloyd

Code: Select all

//TextBackgroundBoxCreator
//©2008 Lloyd Alvarez http://aescripts.com
//
//to run this script, set your text on one text layer, switching the text using keyframes on the Source Text property.
//create a solid that is 1000x1000 with square pixel PAR, position it below the text layer and select both the text
// layer and the solid before running the script.
//
//



var error = "To run this script you must select both a 1000x1000 pixel solid and a text layer above it";

var myComp = app.project.activeItem;
var theLayer = myComp.selectedLayers;


if (theLayer.length != 2) {alert(error)}
else
{

var myWorkAreaInFrames = myComp.workAreaDuration * myComp.frameRate;
var myWorkAreaStartInFrames = myComp.workAreaStart * myComp.frameRate;

for (i=1; i < myWorkAreaInFrames; i++) {
var myTime= ((myWorkAreaStartInFrames-1) + i) / myComp.frameRate;

var boundsObject = theLayer[0].sourceRectAtTime(myTime, true);
//alert(boundsObject.width);

var myWidth = (boundsObject.width/10);
var myHeight = (boundsObject.height/10);
theLayer[1].anchorPoint.setValue([0,0]);
theLayer[1].scale.setValueAtTime(myTime,[myWidth,myHeight]);


writeLn("Processing frame " + i + " out of " + Math.round(myWorkAreaInFrames)); //write the progress to the info window
clearOutput(); //clear the line after it's written
}//close for loop

}
Skydance
Posts: 2
Joined: June 5th, 2005, 10:23 am
Location: Poland
Contact:

thx so much lloydalvarez :D
Post Reply