合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
``` // CreateSeveralTrimmed Adjustment Layers.jsx // ©June 2008 Lloyd Alvarez http://aescripts.com // // Creates a trimmed Adjustment Layer for every one of the selected layers. // You can define what the prefix name for the adj layer is in the user variables below. // If you want to include the layer name in the Adj Layer set the variable to 1. // To not include the layer name set the variable to 0. // *****Note that AE has a 31 character limit for layer names so the name of the // adjustment layer will be truncated to the first 31 characters ******** // ////////////////////////////////////////////////////////////////////// // // USER VARIABLES: // var adjustementLayerPrefix = "Adj Lyr for "; var addLayerNameAfterPrefix = 1; // 1 for yes, 0 for no // // ////////////////////////////////////////////////////////////////////// var proj = app.project; var undoStr = "Create Several Trimmed Adj Layers"; if (proj){ var myComp = app.project.activeItem; if (myComp != null && (myComp instanceof CompItem)){ app.beginUndoGroup(undoStr); var myLayers = myComp.selectedLayers; var saveIn = 0; var saveOut = 0; for (i=0; i <= myLayers.length-1; i++){ currentLayer = myLayers[i]; saveIn = (currentLayer.stretch < 0) ? currentLayer.outPoint : currentLayer.inPoint; saveOut = (currentLayer.stretch < 0) ? currentLayer.inPoint : currentLayer.outPoint; saveIndex = currentLayer.index; saveName = (addLayerNameAfterPrefix) ? adjustementLayerPrefix + currentLayer.name : adjustementLayerPrefix; var newAdjLayer = myComp.layers.addSolid([0,0,0], saveName.substring(0, 31) , myComp.width, myComp.height, myComp.pixelAspect, myComp.duration); newAdjLayer.adjustmentLayer = true; newAdjLayer.moveBefore(myLayers[i]); newAdjLayer.inPoint = saveIn newAdjLayer.outPoint = saveOut; } app.endUndoGroup(); } else { alert("Please select an active comp to use this script"); } } else { alert("Please open a project first to use this script."); } ```