i'm only starting in maya and i was wondering if there's a way to get the last selected "item name" from the outliner in mel for me to use in a script. I want to automate a job.
if i get a way of collecting the name of the selected item i can then write code to add joints to that group only. I will also use a dialog box for entering the number i want to create but this is sorted.
I can't find a way of getting the name of the group other than typing them in.
There are several ways to do this. One way is to use global variables. Another way is the usage of optionvars. I'd prefer optionvars. But it you want to use an UI for creating and adding joints, it could be useful to memorize the selected objects in your script. And especially for UI's, I recommend the usage of python, it is much more compact and easier to read in this case.