Identifying layers with expressions

What type of scripts do you need?

Moderator: byronnash

Post Reply
ymmij
Posts: 28
Joined: December 1st, 2006, 1:20 pm

June 19th, 2008, 11:33 pm

Is there a script around that will search and report all the layers in the project that includes layers? Even better find and tag them in some way?

Thanks,

Russ
berniebernie
Posts: 33
Joined: February 7th, 2005, 7:32 am
Contact:

August 5th, 2008, 3:44 am

you mean sort between lights, cameras, footage and comps ?

it's fairly easy to do with scripting. If you still need it I'll give it a shot.

matt
Boom boom boom.
ymmij
Posts: 28
Joined: December 1st, 2006, 1:20 pm

August 5th, 2008, 2:14 pm

mlk wrote:you mean sort between lights, cameras, footage and comps ?

it's fairly easy to do with scripting. If you still need it I'll give it a shot.

matt
Sorry, I realize now that I wrote out my request incorrectly. I am looking for a script that will identify any layers that include expressions.
The expressions in layers is never obvious, and if there was a script like Paul Tuersley "Search Effects" which found expressioned layers that would be handy.

Thanks
User avatar
Atomic
Posts: 157
Joined: April 30th, 2007, 5:55 am
Location: United States, Ohio

August 6th, 2008, 5:25 am

You can always just Select All and press the U-Key. Any expressions will be revealed.
"Up And Atom

No...No

Up And At Them!"
berniebernie
Posts: 33
Joined: February 7th, 2005, 7:32 am
Contact:

August 6th, 2008, 6:08 am

Ah ok, I thought you wanted to use expressions to do the deed...


Actually it should be fairly straightforward, as you can query the 'expression' string of a layer
app.project.item(index).layer(index).expression
I'll give it a tug later, I do not have after effects at work (shake and nuke)
Boom boom boom.
ymmij
Posts: 28
Joined: December 1st, 2006, 1:20 pm

August 6th, 2008, 2:13 pm

mlk wrote:Ah ok, I thought you wanted to use expressions to do the deed...


Actually it should be fairly straightforward, as you can query the 'expression' string of a layer
app.project.item(index).layer(index).expression
I'll give it a tug later, I do not have after effects at work (shake and nuke)
Great...look forward to it.
berniebernie
Posts: 33
Joined: February 7th, 2005, 7:32 am
Contact:

August 6th, 2008, 4:46 pm

Here ya go

Code: Select all

var token = 0;
function selectExpressions(){
      AI = app.project.activeItem;
          for (a=1;a<AI.layers.length+1; a++){
            AI.layers[a].selected=false;
			curLayer = AI.layers[a];
			if(curLayer.position.expression.length > 0 || curLayer.opacity.expression.length > 0 || curLayer.rotation.expression.length > 0 || curLayer.anchorPoint.expression.length > 0 || curLayer.scale.expression.length > 0){
				token++;
				curLayer.selected = true;
			}
          }
return token;
}
var result = selectExpressions();
alert("Found " + result + " layer(s) with expressions");

I don't have time to code the whole 'iterate through ever property of each layer' thing (it only checks rot, pos, anchor, scale and opacity expressions) but I believe Jeff Almasol from http://www.redefinery.com/ has a gimmeprops AE script that could help you do that.

cheers

mlk
Boom boom boom.
ymmij
Posts: 28
Joined: December 1st, 2006, 1:20 pm

August 7th, 2008, 5:46 pm

mlk wrote:Here ya go

Code: Select all

var token = 0;
function selectExpressions(){
      AI = app.project.activeItem;
          for (a=1;a<AI.layers.length+1; a++){
            AI.layers[a].selected=false;
			curLayer = AI.layers[a];
			if(curLayer.position.expression.length > 0 || curLayer.opacity.expression.length > 0 || curLayer.rotation.expression.length > 0 || curLayer.anchorPoint.expression.length > 0 || curLayer.scale.expression.length > 0){
				token++;
				curLayer.selected = true;
			}
          }
return token;
}
var result = selectExpressions();
alert("Found " + result + " layer(s) with expressions");

I don't have time to code the whole 'iterate through ever property of each layer' thing (it only checks rot, pos, anchor, scale and opacity expressions) but I believe Jeff Almasol from http://www.redefinery.com/ has a gimmeprops AE script that could help you do that.

cheers

mlk
Thanks for that. Hopefully you or some other script wizard can pick this up and extend it a little more. I can do a bit of expressions, but scripting way beyond me.
In the mean time this is very helpful.

Thanks again.
Post Reply