AE ENHANCERS

Expressions/Scripts/Presets
It is currently Wed Nov 26, 2014 11:23 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: All Solos off
PostPosted: Mon Oct 31, 2011 10:34 am 
Offline

Joined: Sun May 01, 2005 1:52 pm
Posts: 139
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.


Top
 Profile  
 
 Post subject: Re: All Solos off
PostPosted: Mon Oct 31, 2011 11:50 am 
Offline

Joined: Sat Jun 26, 2004 10:01 am
Posts: 309
Location: Folsom, CA
This should do it:

Code:
// 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

_________________
http://www.motionscript.com


Top
 Profile  
 
 Post subject: Re: All Solos off
PostPosted: Mon Oct 31, 2011 12:53 pm 
Offline

Joined: Sun May 01, 2005 1:52 pm
Posts: 139
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.


Top
 Profile  
 
 Post subject: Re: All Solos off
PostPosted: Mon Oct 31, 2011 1:12 pm 
Offline

Joined: Sat Jun 26, 2004 10:01 am
Posts: 309
Location: Folsom, CA
Ah yes, good catch. Try this version:

Code:
// 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

_________________
http://www.motionscript.com


Top
 Profile  
 
 Post subject: Re: All Solos off
PostPosted: Mon Oct 31, 2011 7:59 pm 
Offline

Joined: Sun May 01, 2005 1:52 pm
Posts: 139
Yes! That works fantastically.

Is there any way to allow it to be "undo-able?"


Top
 Profile  
 
 Post subject: Re: All Solos off
PostPosted: Mon Oct 31, 2011 8:21 pm 
Offline

Joined: Sat Jun 26, 2004 10:01 am
Posts: 309
Location: Folsom, CA
Like this:

Code:
// 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

_________________
http://www.motionscript.com


Top
 Profile  
 
 Post subject: Re: All Solos off
PostPosted: Tue Nov 01, 2011 10:16 am 
Offline

Joined: Sun May 01, 2005 1:52 pm
Posts: 139
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.


Top
 Profile  
 
 Post subject: Re: All Solos off
PostPosted: Thu Nov 03, 2011 3:47 am 
Offline

Joined: Sat Jun 05, 2004 7:59 am
Posts: 698
Location: London, UK
Scripts don't have access to the layout of Timeline columns, so this isn't possible.


Top
 Profile  
 
 Post subject: Re: All Solos off
PostPosted: Fri Jan 27, 2012 10:57 am 
Offline

Joined: Sun May 01, 2005 1:52 pm
Posts: 139
Can I alter the "solos" script so that it locks all layers in a project?

I tried this:
Code:
{
  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.


Top
 Profile  
 
 Post subject: Re: All Solos off
PostPosted: Fri Jan 27, 2012 11:16 am 
Offline

Joined: Sat Jun 05, 2004 7:59 am
Posts: 698
Location: London, UK
It's .locked

You can find it as an attribute of the Layer object in the CS3 scripting guide.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group