-
Expression result changes when I change the layer order, but it shouldn’t
I have over a hundred layers that need to automatically scale to a specific size, each one has a different size, so I made a null and added a slider control for each one, I renamed the sliders 1,2,3, etc. all the way to 131.
Then I applied the expression below and my intention is to have each slider being read using the index number of the layer, so layer number 2 will read slider 2, and so forth.
The problem is that when I send the “xp” layer to the bottom of the stack so each new layer I create keeps the correct index number then the expression gets all weird and does not return the number assigned to the slider but something completely different, which I haven’t been able to figure out, for example: Layer 1 with the expression controller layer on top should return 61%, which is the value I assigned to the slider, but with the expression controller below the number returned is .8%
Can anyone help me understand why the expression is not working as expected?
Thanks in advance.
fadeDur = thisComp.layer("xp").effect("fadeDur")("Slider");
scl=thisLayer.index;
s=ease(time,inPoint,inPoint+fadeDur,0,thisComp.layer("xp").effect(scl)("Slider"));
[s,s];