Copy link to clipboard
Copied
Hi,
I'm trying to write an expression that takes into account the number of effects a targeted layer has. In a perfect world, it would be nice to get a count of only certain effects (ex: how many Slider Controls are applied)... but I'd rather start basic and work my way up to that (if it can be done at all).
So... has anyone done anything like this before / can this be done?
~pemling
Oh, and I'm using (as of today, at least) the most current version of AE: 13.2.0.49
I think this will give you the number of effects:
numEffects = thisComp.layer("Layer 1")("Effects").numProperties;
Getting the number of Slider Controls could be tricky, if they have been renamed an no longer have "Slider Control" in the name.
Dan
Copy link to clipboard
Copied
I think this will give you the number of effects:
numEffects = thisComp.layer("Layer 1")("Effects").numProperties;
Getting the number of Slider Controls could be tricky, if they have been renamed an no longer have "Slider Control" in the name.
Dan
Copy link to clipboard
Copied
Thanks Dan, looks like that worked! I'm able to get a count of the number of effects currently applied to a layer!
If you left "Slider Control" somewhere in the name of the effect ("Slider Control - 1" or "__Slider Control - 1" for example), is it possible to get a count of just those effects? Just trying to figure out what can/can't be done...
Copy link to clipboard
Copied
Something like this should work:
numEffects = thisComp.layer("Layer 1")("Effects").numProperties;
numSliders = 0;
for (i = 1; i <= numEffects; i++){
if (thisComp.layer("Layer 1")("Effects")(i).name.toLowerCase().indexOf("slider control") > -1){
numSliders++;
}
}
numSliders;
Dan
Copy link to clipboard
Copied
Awesome! That's exactly what I needed! Thank you so much!
On Fri, Dec 19, 2014 at 11:53 AM, Dan Ebberts <forums_noreply@adobe.com>
Find more inspiration, events, and resources on the new Adobe Community
Explore Now