Copy link to clipboard
Copied
s = [];
ps = parent.transform.scale.value;
for (i = 0; i < ps.length; i++){
s[i] = value[i]*100/ps[i];
}
s
Copy link to clipboard
Copied
Properties have a default value. Defining s=[] is therefore utterly nonsensical. Likewise, s[i] does not make any sense within your loop. and finally, of course scale is a 2D prooperty, so yopur final line would have to be [s,s] or something like that. Start by actually reading up on how expressions work instead of just reusing someone else's code that you don't understand.
Mylenium
Copy link to clipboard
Copied
It seems you would like to build an array. In JavaScript you do such a thing with push():
arr = ["Foo", "Bar"]
arr.push("Hello World")
>> arr
>> ["Foo", "Bar", "Hello World"]
Try:
val = value[i]*100 / ps[i];
s.push(val);
*Martin