Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Script to activate or mute effects and layers from multiple pre-comp

  • Script to activate or mute effects and layers from multiple pre-comp

    Posted by Felix Henry on October 12, 2021 at 10:53 pm

    Hey i heard about a script like Dugr script but with precomp reacting to the script. So you could select effects and layers from multiple pre-comp and put them in a “folder” in this script and then activate or mutin them in one clic threw the script pannel without opening every locations.. Does it bells guys and girls ? Sanks a lot if it does

    Meng Zhiqun replied 4 years, 6 months ago 2 Members · 1 Reply
  • 1 Reply
  • Meng Zhiqun

    October 30, 2021 at 2:42 pm

    For a simple way to turn on/off effects of a nested comp, you can use this after selecting that comp in your mastercomp.

    var proj = app.project; var projComp = app.project.activeItem;

    var selLay = projComp.selectedLayers;

    var foundFx = 0;

    for(var i = 0; i <= selLay.length-1; i++){

    var curLay = selLay[i];

    curLay.selected = false;

    if(curLay.source.typeName == "Composition"){

    var curSNumLay = curLay.source.numLayers;

    for(var ci = 1; ci <= curSNumLay; ci++){

    var curSLay = curLay.source.layer(ci);

    if(curSLay.effectsActive == true){

    foundFx = 1;

    break;

    }

    }

    if(foundFx == 1){

    for(var ci1 = 1; ci1 <= curSNumLay; ci1++){

    var curSLay = curLay.source.layer(ci1);

    curSLay.effectsActive = false;

    }

    }else{

    for(var ci1 = 1; ci1 <= curSNumLay; ci1++){

    var curSLay = curLay.source.layer(ci1);

    curSLay.effectsActive = true;

    }

    }

    }

    }

    However, this turns All effects on all layers off and on. To keep a history of which layers in which comp has effects turned off/on before switching them, you can write a tmp text file to read later. Hope this helps!

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