PDA

View Full Version : Sourcing vs. Executing a script


stzaske
07-22-2003, 03:28 PM
Bentlama recently distributed a nice MEL script that finds all joints in a scene, and changes the IK attribute for each joint to "STICKY". A nice script for people using 4.5 scenes in Maya 5.

What I find confusing though, is that to run his script, you don't execute it, you source it. There may be other examples of this, but it is the first time I've seen it. "Sourcing" his script seems to run it, but sourcing other scripts doesn't seem to run them.

I've purchased 2 of the 3 available MEL books, and in each, Sourcing is only slightly mentioned. As a MEL newbie, sourcing has come to mean (to me) just a hassle of a command. Something I do (have to do) EVERY time I run or test my script.

Can someone explain to me why Bentlama's wrote his script in such a manor, and what the benefit would be?

Question 2, how/why does sourcing his script cause it to run?

-=STZ=-

dwalden74
07-22-2003, 05:38 PM
Can someone explain to me why Bentlama's wrote his script in such a manor

No idea. Because he didn´t know any better....? Why don´t you ask him.


how/why does sourcing his script cause it to run

Because he added a line in his script that actually executes the procedure.

If you´re just starting out with MEL I wouldn´t recommend learning this approach... you´re better off dissecting some of the AW scripts in the "others" or "startup" directory of you Maya installation.

:beer:
David

CGTalk Moderation
01-15-2006, 05:00 PM
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.