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.
All Solos off
Moderator: byronnash
-
- Posts: 320
- Joined: June 26th, 2004, 10:01 am
- Location: Folsom, CA
- Contact:
This should do it:
Dan
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;
}
}
}
}
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.
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.
-
- Posts: 320
- Joined: June 26th, 2004, 10:01 am
- Location: Folsom, CA
- Contact:
Ah yes, good catch. Try this version:
Dan
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
-
- Posts: 320
- Joined: June 26th, 2004, 10:01 am
- Location: Folsom, CA
- Contact:
Like this:
Dan
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();
}
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.
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.
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
Scripts don't have access to the layout of Timeline columns, so this isn't possible.
Can I alter the "solos" script so that it locks all layers in a project?
I tried this:
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.
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();
}
If anyone can alter this and get it to work, I'd appreciate it.
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
It's .locked
You can find it as an attribute of the Layer object in the CS3 scripting guide.
You can find it as an attribute of the Layer object in the CS3 scripting guide.