Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Script Is Creating Duplicate Presets

  • Script Is Creating Duplicate Presets

    Posted by Sean Franklin on April 15, 2015 at 4:59 am

    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!
    -Tim

    app.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

    Sean Franklin replied 11 years ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy