I've been trying to work on my MEL Scripting by creating a cleanup script in Maya and I've hit a roadbump.
The script creates a new window with a few checkboxes with two buttons to confirm and close the window. Before running, it checks to see if you have an object selected before doing anything. In the back end, it's querying the checkboxes and running the commands. Here's what the window prints out:
This error pops up when I select all of the text in the script and hit Enter:
PolishObjectUI;
// Error: line 98: Please select an Object(s) //
When I try to run PolishObjectUI, it gives me this
PolishObjectUI;
// Error: line 34: Flags must come before objects: -c //
I've attached the script to this post for people to see and run. Hopefully someone just finds a typo
Replies
I didn't get the first error,but got a :
Fixed it by swapping $lightmapUV variable and $lightmaps variable at line 89.Then another error came because you wrote checkbox instead of checkBox in the procedures.Fixed it,and now i had a confirm dialog about pivot point or something.Either yes or no resulted in two different errors.
Even after fixing the -label error the UI looked badly structured due to multiple layouts not closed (by using setParent command).
In short,the code you provided is either not complete,not properly written or i might have failed to really understand it
Once you're done work on procedures by following the buttons order (from top to bottom) or simply start with the procedures you are more/less comfortable with.
Good luck with the script,really nice idea btw