Page 1 of 1
Identifying layers with expressions
Posted: June 19th, 2008, 11:33 pm
by ymmij
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
Re: Identifying layers with expressions
Posted: August 5th, 2008, 3:44 am
by berniebernie
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
Re: Identifying layers with expressions
Posted: August 5th, 2008, 2:14 pm
by ymmij
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
Re: Identifying layers with expressions
Posted: August 6th, 2008, 5:25 am
by Atomic
You can always just Select All and press the U-Key. Any expressions will be revealed.
Re: Identifying layers with expressions
Posted: August 6th, 2008, 6:08 am
by berniebernie
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)
Re: Identifying layers with expressions
Posted: August 6th, 2008, 2:13 pm
by ymmij
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.
Re: Identifying layers with expressions
Posted: August 6th, 2008, 4:46 pm
by berniebernie
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
Re: Identifying layers with expressions
Posted: August 7th, 2008, 5:46 pm
by ymmij
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.