So i'm an idiot when it comes to MEL. Here's what i wanted to do.... i have 10 textures that i want to connect to several hundred spheres with the same material. I plan to use a triple switch to achieve this, however connecting the textures to that many spheres by hand thru the switch would make me want to throw things.... so i can up with this script:
////////////////////////
$switchNode = "tripleShadingSwitch1";
for($i = 0; $i < 10; $i++) {
int $rep = 10;
connectAttr -f ($psdFileTex[($i)] + ".outColor") ($switchNode + ".input[" + (($i) + (0 * $rep)) + "].inTriple");
connectAttr -f ($psdFileTex[($i)] + ".outColor") ($switchNode + ".input[" + (($i) + (1 * $rep)) + "].inTriple");
connectAttr -f ($psdFileTex[($i)] + ".outColor") ($switchNode + ".input[" + (($i) + (2 * $rep)) + "].inTriple");
};
//////////////////////
I couldn't figure out how to get the textures files to loop back to 1 after it had reached 10, so instead i duplicated the lines connecting the attributes about 50 times and just changed the multiplier at the end. i used the "$rep" variable instead of just putting a 10 because theres a chance I will only be using 8 textures instead of 10 and i didn't want to go back and re-change all those lines of code. I realize is probably the dumbest way to do this (it works though), but i don't really know what i'm doing. Love to hear a better way of achieving this if anyone can help me. Thanks! -DD