-
Problem with repeating expression (for checking if layer exists)
Hi there,
I have a problem with the repeating of an expression.
What I want to accomplish (The expression is on a slider).
For every Layer (in another Comp)
1. Check if layer(name”n”) exists
2.1 If yes
2.1.1 Check for 2 attributes of layer(name”n”)
2.1.2 Add .xPosition from layer(name”n”) to slider
2.1.3 Repeat from 1. with “n+1”
2.2 If not, repeat from 1. with “n+1”I have part 1. to 2.1.2, but I can’t get my expression repeating the steps 🙁
Any suggestions on how to do this?A big thank you in advance from Germany,
FelixI entered the what I already have below:
n = 1try{
L = comp("compname").layer("layername " + n);
exists = true;
}catch (err){
exists = false;
}if (exists){
if ((comp("compname").layer("layername " + n) != null) && (comp("compname").layer("layername " + n).opacity > 0 ))
{comp("compname").layer("layername " + n).effect("Einstellungen für Schieberegler")("Schieberegler")}
else
{value}}else{
{value}
}