string $selections[] = `ls -sl`; string $selection; for ($selection in $selections) { addAttr -ln vcoord -at double -min 0 -max 1 $selection; setAttr -e -keyable true ($selection + ".vcoord"); }
Wise words my friend. This is why I always put everything inside an extra pair of curly brackets when noodling around in the script editor. This way you avoid declaring a bunch of global variables that can do all kinds of nasty things...Originally posted by Alan
The code looks fine to me though. You may of had an old variable called selection already declared as a string array and that's why it was bitching.