Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Oct 12, 2021 Oct 12, 2021

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

TOPICS
FAQ , Resources
163
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 31, 2021 Oct 31, 2021
LATEST

For a simple way to turn on/off effects of a nested comp, you can use this after selecting that comp in your mastercomp. 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!

 

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;

            }

        }

    }

}

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines