Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Quickly modifying effects settings on many tracks

  • Quickly modifying effects settings on many tracks

    Posted by Thomas Hannen on May 18, 2012 at 6:06 am

    Hi,

    If I’ve used an effect on many text layers (e.g. “Roughen Edges”), and I suddenly realise that I need to reduce the Border setting on all of the tracks, is there a script that I could write to loop through every track in my project, see if it contains the plugin, and if it does, adjust the “Border” setting from 1.6 to 0.6?

    Thanks in advance!

    Dan Ebberts replied 14 years ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    May 18, 2012 at 6:38 am

    Try this:


    {
    function main(){
    var myComp = app.project.activeItem;
    if (myComp == null || !(myComp instanceof CompItem)){
    alert ("No comp selected.");
    return;
    }
    for (var i = 1; i <= myComp.numLayers; i++){
    var myEffect = myComp.layer(i).property("Effects");
    for (var j = 1; j <= myEffect.numProperties; j++){
    if (myEffect.property(j).name == "Roughen Edges"){
    myEffect.property(j).property("Border").setValue(0.6);
    }
    }

    }

    }
    main()
    }

    Dan

  • Thomas Hannen

    May 18, 2012 at 6:48 am

    Thanks Dan,
    Would this work down through nested comps recursively?

  • Dan Ebberts

    May 18, 2012 at 7:02 am

    Nope, but this should:


    {
    function processComp(theComp){
    for (var i = 1; i <= theComp.numLayers; i++){
    var myEffect = theComp.layer(i).property("Effects");
    for (var j = 1; j <= myEffect.numProperties; j++){
    if (myEffect.property(j).name == "Roughen Edges"){
    myEffect.property(j).property("Border").setValue(0.6);
    }
    }
    if ((theComp.layer(i) instanceof AVLayer) && (theComp.layer(i).source instanceof CompItem))
    processComp(theComp.layer(i).source);
    }
    }
    function main(){
    var myComp = app.project.activeItem;
    if (myComp == null || !(myComp instanceof CompItem)){
    alert ("No comp selected.");
    return;
    }

    processComp(myComp);

    }
    main()
    }

    Dan

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