Hi, Before anything else I would like to say that this is my 4th day of having a crack at MEL-script and probably need a lot more help than I'm asking for right now. But here we go...
I want to define the selected object in my scene as a variable. As far as I understand it's done like this:
string $object = ls -sl;
This works so far.My next step is to create a UI with a slider to control the translation of the object. This is what I've found so far.
1) well first off restart maya ^^ you have most likely defined $object before so you can not redifine it. Maya remembers all variables you define each session. And the only way to clear it is to reboot maya. (as far as i know)
2) secondly the "ls" command returns a string array. so if you want to define it correctly you would need to write
string $object[] = 'ls -sl';
3) now if you would want to use it in your window code you would need to tell maya which object in the string array you would want to use. In order to do that write a number in the brackets like this.