how to store a Mel procedure in a scene

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 05 May 2003   #1
how to store a Mel procedure in a scene

Hi all,

I need to make a "portable" scene with a custom Mel procedure inside the scene.

I want this procedure to be executed (once) when I first load the scene, but I dont want to store the procedure in the path script.

Any idea of how to do that?

Old 05 May 2003   #2
in the script editor you have the possibility to say when a script will be executed..
i think there is a "load scene" or something toggel as well


Old 05 May 2003   #3
look out for the scriptNode inside Maya. this can hold any mel script inside a scene.
heimwerker never die
Old 05 May 2003   #4

scriptNode works , but I have to modify the code (sigh!) in order to put the script in the script node.

There is a way to put a procedure already "sourced" by maya in the scriptNode?


Thank Alexx & Svenip
Old 05 May 2003   #5
are you sure? you dont have to modify the code..

you can open you expression (!) editor, in the menu "select Filter" -> "by scipt node name".

there you can copy paste your script and then hit edit.
after doing that you can choose when to execute in the drop down menu "Execute on"


Old 05 May 2003   #6
you're right Alexx, it works without rewriting the code!

Thanks, its a very nice tool!
Old 05 May 2003   #7
and just to mention..

there is a mel command that encodes your script to pass it e.g. to the script node command..
the only thing bad about it is: i can not remember the name of it anymore


Old 05 May 2003   #8
isn't there a way to make your scripts available for ANY scene?? I thought dropping them into the Maya4.5/scripts folder would do the trick, but it hasn't worked for me so far. I just finished a save script that I want available for any scene I work on, but I can't get the thing to source when Maya loads. I thought it would be simple, but of course....

can anyone help me get this thing to work??
Old 05 May 2003   #9
cant remember the name..

to the scripts in your scripts folder you only have direct access.. but they are not sourced automatically..

but you can create a mel file, that gets started on maya start.. but goddamn.. i can not remember the name..

was something like startup.mel or so..
everything in there gets executed when maya has loaded up..

i come back here when i remember and checked out


Old 05 May 2003   #10

what I ended up doing was putting this line into my userSetup.mel file:

source davesave.mel;

that sourced the save script I wrote and stored in the maya/scripts directory. I still thought there was an easier way to do it, but oh well... this works. thanks!
Old 05 May 2003   #11
hehe.. yeah.. that was it..

i needed that so seldom and later always did it another way..
glad you found it

i think there is no other way to get that working..


Old 05 May 2003   #12

you thinking encodeString? automate sticking in all the escapes and other syntactical gear so you can pass it happily as a string to scriptNode command?

Old 05 May 2003   #13
yep.. that´s it
Old 01 January 2006   #14
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 02:26 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.