Load a shelf from a non-standard location without editing the maya.env file

Hey, I need to be able to load a series of shelf files (in a single location) in maya on start up without editing the maya.env file. Is there a way to load a shelf manually in the userSetup.py/mel (just the first idea that comes to mind)? All possible solutions are welcome, thanks!

short answer, yes. there are many approaches to getting Shelves from non-standard locations.

easiest approach is update the Maya Environment Variable (MAYA_SHELF_PATH) that locates Shelves. You can do this easily in the userSetup.mel with the getenv and putenv commands.

http://download.autodesk.com/global/docs/maya2013/en_us/files/Environment_Variables_File_path_variables.htm

I tried that with userSetup.py but it didnt work. Does userSetup.mel get loaded early enough to make that change?

userSetup.py does run later than userSetup.mel, that may be part of the problem.

There should be MEL procedure buried in the Maya Program Folder for adding, removing, and loading shelves. You could manually load shelves through userSetup and not worry about environment variables.

You can try this MEL Proc to manually load your shelf: loadNewShelf (string $file)