- April 12, 2005 at 4:39 am
I’m writing a script to go through a ton of layers, I want to add expressions to different types of layers. The first part of the script goes to layer ‘i’ and tests to see if it is light layer. I want to write something like this:
var activeLayer = selectedComp.layer(i);
if(activeLayer instanceof LightItem;
However, I get the error “LightItem is undefined”
What are the different types of layers that can be found in a composition, and how can they be tested to see if they are one layer type or another?
- April 12, 2005 at 4:54 am
Sort of found a workaround in the scripting manual (please, somebody write a good manual in the next version!) to see if a layer is a camera or light…
Check to see if you can add an effect to it (lights and cameras cannot have effects) by sending this test:
if(activeLayer (“Effects”) == null)
Surely, there must be another way?
Log in to reply.