-
Problem Scale expression… what i’m wrong?
Hi all!
This is my first time I post here, but I followed you for a very long time.
I have a problem with a (simple?) expression.
I need to link a layer’s Scale to a Null Scale. I need that, if the scale of null is bigger than 100, mi main layer is that value -15, while if the value of null is 100 or less, my layer is the value of null.
I have used an else if function (ok, I could use a simple if-else, but the problem still remains), but it always returns me a problem on a variable.
what’s I wrong?
This is the problem:
sc = thisComp.layer("SCALA_SECONDA_PARTE").transform.scale; // Error: undefined value used in expression (could be an out of range array subscript?)
vaX = transform.scale[0];
vaY = transform.scale[1];
scHigh = sc-15;
if (sc == 100) {
[vaX,vaY]
} else if (sc <100) {
[scHigh,scHigh]
} else if (sc<100) {
[sc,sc]
}I tried to write it pointing only one dimension of the null’s scale (sc = thisComp.layer(“SCALA_SECONDA_PARTE”).transform.scale[0]; , and again, same error.
I’m still learning the expressions, so thank all for your help! 🙂