Maya 2012 Shelf submission [SOLVED]

[i]I’m having more trouble with the Maya shelf button for deadline than I can even understand :S

On all the artist machines here, they all load usersetup.py OR usersetup.mel from the network automatically, and this works fine for other shelf items.
Part of the problem, is that I don’t know Maya at all, I’m a 3ds Max user by nature, but none of the artists here are technical enough to tell me ANYTHING about how their Maya is set up, and with me being the IT guy; I’m the one who has to learn! :S

On most machines, the thinkbox shelf refuses to appear at all, despite usersetup.mel containing; source “InitDeadlineSubmitter.mel”;
I’ve also tried inserting that line into usersetup.py but it didn’t work either (it doesn’t like the syntax).

The Maya/Scripts/startup folders on each machine all contain InitDeadlineSubmitter.mel as they should, all machines have deadline client installed and are all pointed at the correct repository. Yet nothing seems to make most of these machines load the shelf.
There are a couple of machines that do occasionally seem to load the shelf, but I’ve long since given up on trying to figure out how and why they work and others don’t.

Is there maybe some way I can force the shelf/button into Maya? Reason being that being able to submit tile renders is going to be really useful for us soon, and the regular Monitor submission window doesn’t include tile rendering options.

Thanks,[/i]

Okay so after much consultation with our Maya animator as well as some of our outsourced script guys; we’ve found a solution!

We added the normal;
source “InitDeadlineSubmitter.mel”;
To the userSetup.mel but we didn’t want it to create a new shelf, we just wanted to add it to an existing custom shelf.
That loads InitDeadlineSubmitter.mel which in turn loads SubmitMayaToDeadline.mel

We excluded the top “$addshelf” section between /* and */ in order to prevent the creation of the new shelf.
So now we just needed to execute the addition of the shelf button itself and associated commands into maya…

Because the scripts are based on a server, our solution looked like this;
source “T:/OUR/PATH/TO/SERVER/SubmitMayaToDeadline.mel”;
SubmitJobToDeadline

Highlight all the text, drag and drop to the shelf desired, then right click and edit the button, set custom icon etc, and then ‘save all shelves’
Then just open the shelf file locally, and copy and paste out the added code (so that it’s properly formatted by Maya itself) into the server version of the script, which means it gets propagated to every machine each time it’s loaded.

Huzzah!