-
Script Is Creating Duplicate Presets
Hi everyone,
I’m working on a script that will create a new composition for each item in the project and apply a set of presets to that layer.My current script for some reason is duplicating my second preset one time depending on what preset it is. I can’t figure out why but when I apply transform presets it’s fine but if I use a preset like denoiser II or a Particular preset it duplicates it..
I’m still new to scripting so this may be a pretty basic issue..
What am I doing wrong here?
Also, can anyone point me in the right direction on how to create a UI to select a preset rather than having to type it in in the script?
Thanks!
-Timapp.beginUndoGroup("UNDO")var mySelectedItems = [];
for (var i = 1; i <= app.project.numItems; i++){
if (app.project.item(i).selected)
mySelectedItems[mySelectedItems.length] = app.project.item(i);
}
var presetPath = ["/Applications/Adobe After Effects CC 2014/Presets/Behaviors/Drift Over Time.ffx",
"/Applications/Adobe After Effects CC 2014/Presets/Image - Creative/Grayscale 1.ffx"];for (var i = 0; i < mySelectedItems.length; i++){
var mySelection = mySelectedItems[i];
var myComp = app.project.items.addComp(mySelection.name, 3840, 2160, 1, mySelection.duration, 24);
var myLayer = myComp.layers.add(mySelection);
for(p = 0; p<presetPath.length; p++){
var presetVar = presetPath[p];
var myPreset = File(presetVar);
var applyPreset =myLayer.applyPreset(myPreset);
}}
app.endUndoGroup()
Tim Franklin
Freelance Visual Effects Artist/ Video Editor
Media Asset Manager, CBS Sports Network
http://www.TimSFranklin.com
Sorry, there were no replies found.