Just wondered if anyone could help a newbie who's having a bit of trouble with syntax.
I'm trying to write a MEL script which selects one of ten maya cylinders (named pCylinder1-10). The cylinders are stacked in three piles and I only want to ever select the top one from any pile (yes its that towers of hanoi thing) and move it from one stack to another.
What I really want to do is have each stack stored as an array, the size of which is equal to the number of disks in that stack. The values in the array would correspond to the size of the disks. Moving a disk from one stack to another is simply a case of appending one array and chopping the last value of the other.
However, in order for this process to work I've got to be able to be able to tell MEL to only ever select the top disk in any stack. I tried doing it this way;
select -r pCylinder$array[$count]
$count being an integer equal to the size of the array so that it's always the last value in the array thats selected. Maya really didn't like the syntax though.
Can anyone tell me the correct syntax that lets you use variables inside object names when you use the select command? Or is what i'm trying to do impossible?
Thanks!