Hi,
Thanks for this script.
I currently need to output tons of files into 720x576 DV/PAL comps so I've slightly modified the script to output it correctly.
*** EDIT : I've seen the original script from Byron Nash and it exactly does what I've modified, so, if this script isn't helpful, let me know and I'll delete this post. ***
Here it is :
Code: Select all
//Compify
//Byron Nash, Edited and Improved by Paul Tuersley
//October 2004
//720x486 mode by Lloyd Alvarez August, 2005 (with a little help from Dan Ebberts, thanks Dan!)
//
//This script takes any Comps and makes new 720x486 D1 Aspect Ratio Comps
//with the Comps added and scaled to fit for proper D1 output.
//
//
//Select the Comps you would like resized or select none to do all the Comps
//enter a prefix and suffix at prompt to be appended to the newly created comp name
var mySuffix = "_PAL"; //default values
var myPrefix = "_";
myPrefix = prompt("What prefix would you like to add to the new 720x576 Comps? (*leave it blank for no prefix)", myPrefix);
mySuffix = prompt("What suffix would you like to add to the new 720x576 Comps? (*you have to have a suffix!)", mySuffix);
clearOutput();
var proj = app.project;//set project
if (mySuffix) {
// create undo group if user didn't cancel dialog
app.beginUndoGroup("Compify 576");
var projColl = proj.items;//list of items in project
writeLn("======Compify=======576======");
var myComps = new Array();//array for storing all the comps made
var selItems = app.project.selection;//set selected import items to an array
if (selItems.length > 0){//check to see if anything is selected
var myColl = app.project.selection;//if so the use the selection
var i = 0;
} else {//if not, use entire project contents
var myColl = new Array();
for (j=0; j < projColl.length; j++){//add project list to an array
myColl[j] = projColl[j+1];
}
}
var suffix = mySuffix;
var prefix = myPrefix;
for (i=0; i <= myColl.length; i++) {//loop through the project
var curItem = myColl[i];
if (curItem instanceof CompItem) {//check for footage items
//add suffix to comp name and remove the file extension
var curName = prefix + curItem.name + suffix;
//Truncate comp name if it exceeds the 31 character limit
if (curName.length > 30){
curName = curName.slice(0,29-suffix.length) + " " + suffix;
}
//setup comp variables
var curAspect = curItem.pixelAspect;
var curWidth = curItem.width;
var curHeight = curItem.height;
var compSize = [curWidth,curHeight];
var curDuration = curItem.duration;
var curRate = curItem.frameRate;
var curMB = curItem.motionBlur;
var curFB = curItem.frameBlending;
var cur3D = curItem.draft3d;
//create comp and add layer
var newComp = projColl.addComp(curName,720, 576,1.07,curDuration,curRate);//make new comp
newComp.motionBlur = curMB; //sets Comp Motion Blur, Frame Blend and Draft 3D to match source Comp
newComp.frameBlending = curFB;
newComp.draft3d = cur3D;
var lcoll = newComp.layers;//variable for collection of layer objects in logoComp
lcoll.add(curItem);//add layer
var myLayer = newComp.layer(1);
var myWidth = myLayer.width;
var myHeight = myLayer.height;
var myLayerAspectRatio = (myWidth/myHeight);
var myPropertyScale = myLayer.scale;
var myComp = app.project.activeItem;
var percent = 100; // percent of comp size
var myTargetCompWidth = 720; //target comp width
var myTargetCompHeight = 576; //target comp height
var myTargetCompAspect = 1.07; //target comp pixel aspect ratio
var myCompAspectRatio = (myTargetCompWidth/myTargetCompHeight);
var scaleX = (myTargetCompWidth * myTargetCompAspect)/(myWidth*myLayer.source.pixelAspect);
var scaleY = myTargetCompHeight/myHeight;
myLayer.collapseTransformation = false; //set this to false if you do not wish to collapse transformations
myLayer.property("Scale").setValue([scaleX*percent,scaleX*percent]);
myComps[myComps.length] = newComp;//add comp to array
}
}
writeLn("Created " + myComps.length + " Comps");
app.endUndoGroup();
if (confirm("Would you like to add the new 720x576 Comps to the Render Queue?")){
clearOutput();
var sectionName = "Compify 720x576 Script";
var keyName = "Render comps with this string";
var searchString = "";
if (app.settings.haveSetting(sectionName, keyName)) {
searchString = app.settings.getSetting(sectionName, keyName);
}
//searchString = prompt("What string to render?", searchString);
searchString = mySuffix;
if (searchString) {
app.settings.saveSetting(sectionName, keyName, searchString);
searchString = searchString.toLowerCase();
for (i = 1; i <= app.project.numItems; ++i) {
var curItem = app.project.item(i);
if (curItem instanceof CompItem) {
if (curItem.name.toLowerCase().indexOf(searchString) != -1) {
app.project.renderQueue.items.add(curItem);
}
}
}
}
}
}
Salvador