Thanks Justin, really appreciate your help!
Each of the red outlined components of my design above are separate pre-comps which all have different parts of a technical process happening within them. So I guess that means I need control over the subcomps contained within that main composition I have screen shot?
To solo all subcomps, something like this will work:
function soloRedLayers(layers){
var numSolo = 0;
for (var i = 0; i < layers.length; i++) {
var layer = layers[i+1];
var shouldSolo = false;
if(layer.source instanceof CompItem){
// if layer is comp, then inspect children
var newSoloed = soloRedLayers(layer.source.layers);
if(newSoloed > 0){
// if contains soloed layers, then solo precomp
shouldSolo = true;
numSolo++
}
}
else{
// if layer is labelled red then solo
shouldSolo = layer.label == 1;
numSolo++;
}
layer.solo = shouldSolo;
}
return numSolo;
}
soloRedLayers(app.project.activeItem.layers);
Then to unsolo all your layers, you'll need to run something like this:
function unSoloLayers(layers){
for (var i = 0; i < layers.length; i++) {
var layer = layers[i+1];
layer.solo = false;
if(layer.source instanceof CompItem){
// if layer is comp, then inspect children
unSoloLayers(layer.source.layers);
}
}
}
unSoloLayers(app.project.activeItem.layers);
You'll need to run both of these commands from the main comp.