This works as intended (and the new Z value on the knob helps a ton as to prevent conflicts) however it is feasiable to assume that I might add several more encoders to this setup, and being from a PHP background I immediately want to abstract and Loop.
Code: Select all
//Script setAll(l,v)
if (l != 1 && Platter.z != 1) {
Outer.x = v;
}
if (l != 2 && Platter.z != 2) {
Middle.x = v;
}
if (l != 3 && Platter.z != 3) {
Inner.x = v;
}
Code: Select all
decl encoders;
encoders[1] = Outer;
//also tried the absolute path with no luck: encoders[1] = Platter.Outer;
encoders[2] = Middle;
encoders[3] = Inner;
if (l != 1 && Platter.z != 1) {
encoders[1].x = v;
}
if (l != 2 && Platter.z != 2) {
encoders[2].x = v;
}
if (l != 3 && Platter.z != 3) {
encoders[3].x = v;
}
Code: Select all
decl encoders;
encoders[1] =Outer;
encoders[2] = Middle;
encoders[3] = Inner;
decl i;
decl size = sizeof(encoders);
for (i=1;1<=size;i++) {
if (l != i && Platter.z != i) {
encoders[i].x = v;
}
}