View Full Version : how to store a Mel procedure in a scene
05-19-2003, 06:28 PM
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?
05-19-2003, 08:02 PM
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
05-20-2003, 09:28 AM
look out for the scriptNode inside Maya. this can hold any mel script inside a scene.
05-20-2003, 04:04 PM
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
05-20-2003, 05:08 PM
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"
05-20-2003, 06:31 PM
you're right Alexx, it works without rewriting the code!:thumbsup:
Thanks, its a very nice tool!
05-20-2003, 08:44 PM
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 :)
05-22-2003, 10:52 PM
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.... :banghead:
can anyone help me get this thing to work??
05-22-2003, 10:56 PM
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
05-22-2003, 11:15 PM
what I ended up doing was putting this line into my userSetup.mel file:
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! :)
05-22-2003, 11:19 PM
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..
05-23-2003, 09:53 AM
you thinking encodeString? ...to automate sticking in all the escapes and other syntactical gear so you can pass it happily as a string to scriptNode command?
05-23-2003, 10:54 AM
yep.. thatīs it
01-15-2006, 05:03 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.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.