so without knowing what these are exactly or how they are effecting the object I can’t tell you quite the results. But, I can explain whats going on.
so
s = []; //this is setting a variable for s, to be equal to an iterator
ps=parent.transform.scale.value; //this sets this layers parents scale value to ps
for(i=0; i < ps.length; i++){
s[i]=value[i]*100/ps[i];
}
this is a little more complex, but basically “for” is a loop inside javascript. This loop broken down is
for //do loop in situation ( //bracket tells for loop to look inside here for the situation
i=0; // i is a variable, and it equals 0
i < ps.length; // if i is less than ps.length ( the value number for ps )
*remember ps = parent.transform.scale.value; so it just add .length which calls for the number value*
**in full its parent.transform.scale.value.length;**
i++) // i++ means whatever i is, if before situation is still matching then add one to itself //bracket closes the for loop situation
{ //opens the for loop to allow you to apply something to every instance of the for loop
*in the case above if the value was 50, it would do the for loop 50 times until it stops*
s[i]=value[i]*100/ps[i]; //in this case it’s saying s[i] ^^ we saw i changes depending on the ‘ps.length’ and then calcutes it throughout
s //outputs s
so lets make an example for you:
if the value of scale is 2
s=[];
ps=parent.transform.scale.value;
for(i=0;i<ps.length;i++){
s[i]=value[i]*100/ps[i];
}
( loop broken down )
s[0]=value[0]*100/ps[0];
s[1]=value[1]*100/ps[1];
s[2]=value[2]*100/ps[2];
( end loop )
s