Page 1 of 1
All Solos off
Posted: October 31st, 2011, 10:34 am
by scribling
Is it possible to have a script that turns all solos off in all comps in a project?
This could be a nice pre-flight check before rendering as well as diagnosing problems.
Thanks.
Re: All Solos off
Posted: October 31st, 2011, 11:50 am
by Dan Ebberts
This should do it:
Code: Select all
// turn off solo on all layers
{
var myComp;
for (var i = 1; i <= app.project.numItems; i++){
if (app.project.item(i) instanceof CompItem){
myComp = app.project.item(i);
for (var j = 1; j <= myComp.numLayers; j++){
myComp.layer(j).solo = false;
}
}
}
}
Dan
Re: All Solos off
Posted: October 31st, 2011, 12:53 pm
by scribling
Thanks for the code, but it doesn't work.
It returns "Unable to execute script at line 8. ... Solo flag can not be set on a layer if the layer is not enabled.
I was also looking for something that would run on the entire project, all comps or at least all sub comps of a selected comp.
Thanks.
Re: All Solos off
Posted: October 31st, 2011, 1:12 pm
by Dan Ebberts
Ah yes, good catch. Try this version:
Code: Select all
// turn off solo on all layers
{
var myComp;
for (var i = 1; i <= app.project.numItems; i++){
if (app.project.item(i) instanceof CompItem){
myComp = app.project.item(i);
for (var j = 1; j <= myComp.numLayers; j++){
if (myComp.layer(j).solo) myComp.layer(j).solo = false;
}
}
}
}
Dan
Re: All Solos off
Posted: October 31st, 2011, 7:59 pm
by scribling
Yes! That works fantastically.
Is there any way to allow it to be "undo-able?"
Re: All Solos off
Posted: October 31st, 2011, 8:21 pm
by Dan Ebberts
Like this:
Code: Select all
// turn off solo on all layers
{
var myComp;
app.beginUndoGroup("Turn Off All Solos");
for (var i = 1; i <= app.project.numItems; i++){
if (app.project.item(i) instanceof CompItem){
myComp = app.project.item(i);
for (var j = 1; j <= myComp.numLayers; j++){
if (myComp.layer(j).solo) myComp.layer(j).solo = false;
}
}
}
app.endUndoGroup();
}
Dan
Re: All Solos off
Posted: November 1st, 2011, 10:16 am
by scribling
Oh hell yeah! This works so good it's not even funny!
Thanks!
Say, you don't know of any way to switch the "A/V features" panel to the left or right of the "Layer Name" panel, do you?
I like to work with my A/V panel on the right of the layers (so it's there with everything else and makes sense) and several people I work with like it on the far left.
If there was a way to globally switch that it would make a lot of people happy.
Thanks again.
Re: All Solos off
Posted: November 3rd, 2011, 3:47 am
by Paul Tuersley
Scripts don't have access to the layout of Timeline columns, so this isn't possible.
Re: All Solos off
Posted: January 27th, 2012, 10:57 am
by scribling
Can I alter the "solos" script so that it locks all layers in a project?
I tried this:
Code: Select all
{
var myComp;
app.beginUndoGroup("Lock Everything");
for (var i = 1; i <= app.project.numItems; i++){
if (app.project.item(i) instanceof CompItem){
myComp = app.project.item(i);
for (var j = 1; j <= myComp.numLayers; j++){
if (myComp.layer(j).lock) myComp.layer(j).lock = true;
}
}
}
app.endUndoGroup();
}
That doesn't work. I just don't know what the correct terminology is.
If anyone can alter this and get it to work, I'd appreciate it.
Re: All Solos off
Posted: January 27th, 2012, 11:16 am
by Paul Tuersley
It's .locked
You can find it as an attribute of the Layer object in the CS3 scripting guide.