Creating DVD-Masks out of AE-Comps
Posted: March 11th, 2005, 4:16 am
This script is very useful if you have to render B&W DVD-Button-Masks out of menu-buttons or menu-text which you have created in your AE comps.
Normally, it can be very time consuming to manually switch all of your menu-buttons in all comps to solo, then add it to the render queue - especially if you have many comps and many menu-buttons in your AE-DVD-project.
The trick is now to name these layers with a unique string at the beginning, e.g. "button" -
This script searches for them in your project, switches them to VISIBLE and SOLO, adds the found comps to the render queue while you can specify a global output folder and changes the output module to "TIFF Alpha as RGB" (which means that it will transfer the alpha of your menu-buttons to the RGB-part of the final 24Bit TIFF-image).
Comments and suggestions welcome!
IMPORTANT: BEFORE YOU RUN THIS SCRIPT, YOU ***M U S T*** CREATE EXACTLY THE FOLLOWING NEW OUTPUT MODULE: "TIFF Alpha as RGB". THE IMPORTANT SETTINGS FOR THIS MODULE ARE:
Format: TIFF-Sequence
Video-Output: Format Options: 24Bit/Pixel
Video-Output: Channels: Alpha
Video-Output: Depth: 16,7 Mill Colors
************
IMPORTANT: DON'T FORGET TO SAVE YOUR PROJECT BEFORE RUNNING THIS SCRIPT YOU WILL HAVE TO "RETURN TO PREVIOUS VERSION" IMMEDIATELY AFTER RENDER IS COMPLETE!
Normally, it can be very time consuming to manually switch all of your menu-buttons in all comps to solo, then add it to the render queue - especially if you have many comps and many menu-buttons in your AE-DVD-project.
The trick is now to name these layers with a unique string at the beginning, e.g. "button" -
This script searches for them in your project, switches them to VISIBLE and SOLO, adds the found comps to the render queue while you can specify a global output folder and changes the output module to "TIFF Alpha as RGB" (which means that it will transfer the alpha of your menu-buttons to the RGB-part of the final 24Bit TIFF-image).
Comments and suggestions welcome!
IMPORTANT: BEFORE YOU RUN THIS SCRIPT, YOU ***M U S T*** CREATE EXACTLY THE FOLLOWING NEW OUTPUT MODULE: "TIFF Alpha as RGB". THE IMPORTANT SETTINGS FOR THIS MODULE ARE:
Format: TIFF-Sequence
Video-Output: Format Options: 24Bit/Pixel
Video-Output: Channels: Alpha
Video-Output: Depth: 16,7 Mill Colors
************
IMPORTANT: DON'T FORGET TO SAVE YOUR PROJECT BEFORE RUNNING THIS SCRIPT YOU WILL HAVE TO "RETURN TO PREVIOUS VERSION" IMMEDIATELY AFTER RENDER IS COMPLETE!
Code: Select all
{
// DVD Mask Script
// (c) 2005 Tammo Fornalik
var suchen = ""; //reset field
var start = ""; //reset field
suchen = prompt("Layers to create a mask from starts with string:", suchen);
start = prompt("The buttons timeline position (seconds):", start);
wortl = suchen.length;
var newLocation = folderGetDialog("Choose output destination...");
var gefundene_ebenen = 0;
var gefundene_komps = 0;
app.beginUndoGroup("DVD Masks");
for (a = 1; a <= app.project.numItems; ++a) { //for/next loop through project window
var curItem = app.project.item(a);
if (curItem instanceof CompItem) { //tests if actual item is a comp
//--------------------------------------
var alle_ebenen = curItem.layers.length;
var ebene = curItem.layers;
mask_komp = false;
for (i = 1; i <= alle_ebenen; i++) {
if (ebene[i].name.substring(0, wortl).indexOf(suchen) != -1)
{
gefundene_ebenen++;
mask_komp = true;
ebene[i].enabled = true;
ebene[i].solo = true;
} //end of find routine
}//end of layer loop
if (mask_komp == true) {
gefundene_komps++;
app.project.renderQueue.items.add(curItem); //add item to Render Queue
var num_que = app.project.renderQueue.numItems;
var this_que = app.project.renderQueue.item(num_que);
this_que.applyTemplate("Optimale Einstellungen");
this_que.outputModules[1].applyTemplate("TIFF Alpha as RGB");
var haupt = this_que.outputModule(1).file;
this_que.outputModule(1).file=new File(newLocation.toString()+"/"+"Mask_"+haupt.name);
this_que.timeSpanStart=start;
this_que.timeSpanDuration=1/25;
} //end of Add To Queue
}//end of Is Comp
//---------------------------------------
}//end of loop through project
alert(gefundene_ebenen+" Layer(s) "+"in "+gefundene_komps+" compositions switched to SOLO. Comps added to Render Queue.");
app.endUndoGroup();
app.project.renderQueue.showWindow(true);
//--------------------------------------
}