View Full Version : Autoload A Script

05-17-2007, 04:28 AM
Hi guys I have created a menu innside maya as shown below, now i want to a autoload it when maya is open can anyone help me out.

global proc spiderman(){
menu -label "S3"
-tearOff true

menuItem -label "Leg Rig"
-annotation ""
-command "tlegrig;";

menuItem -label "Hand Rig"
-annotation ""
-command "thandrig;";

menuItem -label "Spine Rig"
-annotation ""
-command "tRig;";


05-17-2007, 04:49 AM
In your maya scripts directory, add these lines to the "userSetup.mel".

source "theNameOfYourScript.mel";
spiderman ();

This sources the script, then executes the proc in script.

If your mel script isn't located in the mel scripts directory, then you'll need to include the path in your source statement.


05-18-2007, 04:43 AM
Thanks man thanks a lot.............. its working well

05-21-2007, 07:40 AM
Do not create and call a procedure if the script is designed to only run at Maya startup. Its a waste of memory.

Just leave away the "global proc blalala()" and do only source blalala.mel;


CGTalk Moderation
05-21-2007, 07:40 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.