Your dedicated rigging-shelf - Sourcing multiple script at once to a shelf
Hello there :-)
I have been looking all over the web for this, but with no luck;
I have a big pile of scripts for rigging. They are scattered around in different shelfs of mine, some for specific projects, some for characters etc.
Now, my main struggle/problem: Is there ANY WAY at all, to just go to my scripts folder, select all my (favourite) rigging scripts, drag and drop them (or something similarly easy) to a dedicated scriptinterface, to then make a shelf for me, instead of sourcing them again, one by one to a new shelf?
Hope it is clear, Have a nice one! nikhatos
I have a tool for organising scripts into menus if that's helpful: https://github.com/morganloomis/ml_tools/blob/master/ml_toolbox.py Basically you just organise yours scripts in folders under an ml_toolbox_menu folder in your script directory, then the script will turn that folder hierarchy into a menu hierarchy on the maya menu bar. Script requirements are that MEL scripts need to have a global proc of the same name as the filename, and python files should have a main() or ui() function to be run.
Nice! That's a real nice way to build UI elements.
It's very similar to what I have been doing, but your method requires so much less input, which would be great. The way I had set it up is that for every script I want to add to a shelf/markingMenu/menu I have to manually say something along the lines of
shelf.addButton(script)
.Having that managed by directories sounds so much better! Thanks for that!
I just whipped up something quickly to do that. It's a bad bad code, but seems to do the job.
Just change the
SHELF_NAME
variable to whatever you want to call your shelf and run the code. It will open up a new maya window which is blank and you need to drag your files on to that window. It should create the shelf and exit.Bear in mind if a shelf with the same name already exists, it will error out.
Tested on Windows 7 - Maya 16.5 and Maya 17
Wow - impressive! ;) Thanks for the quick reply, so eager to try it out! Thank you!
Great share! That is really cool. I need to learn me some Pyside. http://cosmos.toolsfrom.space/ This will let you pull your scripts (as well as native maya commands) from a search bar if that's more up your alley. Haven't personally tried it.
Oh yeah the Cosmos tool - very handy indeed! Thanks for the input! ;)
Yeah, it's such a great tool! I am not using it as I haven't had the time to sit down and migrate my stuff to it, but I always give it as a great tool example, as I feel we need more cool stuff like this in Maya.
And yeah, PySide is really handy! I have only recently started tinkering with it and it seems like it's not too difficult to grasp, but is very powerful.