Hey Ken,
I think the MEL command you may be searching for is: shelfButton
The syntax for it reads:
shelfButton [flags] [shelfButtonName]
It'll let you have multiple icon graphics for the button in different states, so it sounds like what you're looking for from your earlier post.
The best way would probably be to write a quick batch file that any user can run to copy your MEL script to a specific path on their local computer for it to be accessible by Maya.
But...If you're feeling lazy...And if you already have too many other projects to work on anyway...
The shelfButton can also have different commands executed for single Vs. Double-Click Vs. Drag-N-Drop, etc.
You might just have a double-click "source" your file from a shared network volume, and the single-click be the default behaviour that runs your new procedure? (Since most Maya shelf buttons just use default single-click behaviour, they'll only double-click when they need to source it.)
That way you could just have users paste your shelfButton command into the Script Editor from an email you send out. When they execute it they should be able to double-click the icon to source it from the network, then single-click it to run your procedure whenever they need it.
An example of some syntax that might help out could be:
shelfButton -annotation "Run Ken's Script..."
-parent "Custom"
-image1 "/...pathToKensIcon.../IconName.xpm"
-command ("[YourProcedureName]")
-doubleClickCommand ("source [path to network shared MEL file]");
The [-parent "Custom"] flag above puts the button under the "Custom Tab" in the default Maya Layout. Just tweak it to be the name of whichever Tab you'd like it to be under.
Ideally, the script and icon files would be in the local computer's Script / Icon search paths. That way they'd be available even if the user loses access to the network volume, but that's not always possible depending on your company's security configuration(s).
On the local computer, the paths can be set up either for all users (in Maya's default directories), or tailored for a specific user's Maya Prefs path...
If you're having an issue with putting scripts into a directory, but Maya not being able to see them for sourcing, just use the: [rehash] command. Assuming you put the files in the right directories, rehash instructs Maya to rebuild it's directory database of available files.
If it would be of assistance, just drop me an email any time and I'll do what I can to help out with any pathing questions you might have.
(email: brant_nicholas@adelphia.net)
Good luck!
- Brant -
QUOTE(kmcall2 @ 09/20/05, 08:18 PM)
OK,
I have written, (mostly through examples) a tool/script that I would like to distribute through out my company that I work for. So far I have just gone to "open script" read it in and dragged that to a shelf. this leaves a bunch of things undone. I would like to be able to make sure that my icon that I made also gets distributed. and so on.
question is . . .
Is there an explanation somewhere that may help give me guidance?
thank you very much
ken
[snapback]215272[/snapback]