Introduction to Maya - Modeling Fundamentals Vol 1
This course will look at the fundamentals of modeling in Maya with an emphasis on creating good topology. We'll look at what makes a good model in Maya and why objects are modeled in the way they are.
# 1 06-03-2006 , 10:13 PM
JDigital's Avatar
Registered User
Join Date: Mar 2005
Location: Salt Lake City, UT U.S.A.
Posts: 160

Joint orientation Script

Hey guys I found a great script, some of you may have heard of it.

jsOrientJointUI

It is for joint orientation and I hear it is very helpful.

Well I need some help, I am not sure if anyone can answer this but I am new with MEL scripts and I have gotten them to work before, but for some reason I cant get this one to work. I have it in my scripts folder but when I try to type in jsOrientJointUI in the command line it says "Error: Cannot find procedure jsOrientJointUI"

Any ideas? Thanks so much guys. I am held up on a project because I can't figure out this script! Also if anyone knows of any good tutorials or easy ways to orient joints, that would be great!

# 2 06-03-2006 , 11:18 PM
vladimirjp's Avatar
Subscriber
Join Date: Jun 2003
Location: stuck in the 90's boston, USA
Posts: 1,871
u need to source tghe script first.
or restart maya
after install

# 3 07-03-2006 , 03:46 AM
JDigital's Avatar
Registered User
Join Date: Mar 2005
Location: Salt Lake City, UT U.S.A.
Posts: 160
I appreciate your reply.

I did restart maya but it still didnt work. I have not sourced the script, how would I go about that?

Thanks a ton.

# 4 07-03-2006 , 04:18 AM
skywola's Avatar
Registered User
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
Make sure you are typing in the procedure as it appears, i.e., it is case sensitive. For me, If I ever have any doubt as to wether I am typing it correctly, I go to explorer and just copy the file name from there.

Also, if the procedure requires parameters, it will not run without them.

If you restarted Maya, you should not need to source the script.

To do so though, you go into the script editor, Click on

file>source script, then find the file you want to source and click "Open".

When I am working on a programming project, I have a button on my shelf, where I insert code to source ALL the files that are in the scripts director, then whenever I start a new file, I just add it to the list. then whenever I need to source a file, I just press that shelf button.


"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
# 5 07-03-2006 , 04:26 AM
skywola's Avatar
Registered User
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
An alternative way to source a file via MEL is type

source "fileName"; in the script editor . . .

You do not have to add the .mel . . . .

Then highlight ( select ) it, and hit the Enter key on the number pad.

If you hit the other enter key, after you select it, it will only dissappear.


"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
# 6 07-03-2006 , 04:35 AM
JDigital's Avatar
Registered User
Join Date: Mar 2005
Location: Salt Lake City, UT U.S.A.
Posts: 160
You are a genius!! It worked!! Thank you soooo much. I have not been able to work on this project because I couldnt get this MEL script to work.

Thank you so much!!!

# 7 07-03-2006 , 04:31 PM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
hi, hope you don´t mind using your thread, but it´s kind of the same problem I have. I try to source a little script I´ve written - which did allready work on my machine, but all of a sudden it wont!

I get this error message when trying to execute the script with my shelf button

// Error: line 1: Cannot find procedure "snapVertsToZeroX". //

and when trying to source it no prob, but again when executing from shelf SE returns same error.


only after copying all of the code into SE and executing it for the first time the script can be executed from the shelf. but only for the current session. next time - same game. this is making me nuts!


___________


btw, it tried everything what skywola suggested.


everything starts and ends in the right place at the right time.

Last edited by Falott; 07-03-2006 at 04:34 PM.
# 8 07-03-2006 , 04:40 PM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
sry!!

I turned the procedure into a global procedure. problem solved!


everything starts and ends in the right place at the right time.
# 9 07-03-2006 , 04:45 PM
skywola's Avatar
Registered User
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
Yep. I've made that mistake before . . .


"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
# 10 08-03-2006 , 04:22 AM
JDigital's Avatar
Registered User
Join Date: Mar 2005
Location: Salt Lake City, UT U.S.A.
Posts: 160
I noticed that too, how do you turn it to a global procedure? Is it in the code, or in the maya interface?

# 11 08-03-2006 , 05:43 AM
skywola's Avatar
Registered User
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
This is global :

global proc aliasCommands(){
alias q quadSliderWindow;
alias w getSliderWindow;
};


You just put "global" in front of the procedure declaration.


"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
# 12 08-03-2006 , 09:16 AM
skywola's Avatar
Registered User
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
Regarding this joint orient script, I am going to post a short tutorial in a new thread for how to toggle a button. I checked this script out and I have been looking for a script that could use a toggle feature, and this one fit the bill. . . .

The good thing about these forums is while I do help a lot of people out with their coding, I also learn a lot just investigating diffirent scripts and issues that come up. It's really great, because I think that we coders who know MEL well, can help others who are not quite as advanced, and eventually, when their level of coding improves, we will be learning new things from them. . . .

It is also great to see that there are some people who are interested in learning MEL, because if you want to push MAYA to the max, you cannot do it without learning MEL!


"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
# 13 08-03-2006 , 09:55 AM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
hope you have plenty of time, cause I have a ton to learn about mel..hehe!

The good thing about these forums is while I do help a lot of people out with their coding, I also learn a lot


that´s the reason why teachers know so damn well about anything you might not even think about to ask. when they come from university themselves they are University Student Comlete. but after some years they somehow from behind became a fully costumized, provided with tons of different scrips (some of them executing the same thing by different approach), new plugins and with a cool and individual looking environment - Master Of Their Subject Unlimited, cause explanation is exploration of every students creative process of thinking.


everything starts and ends in the right place at the right time.
# 14 08-03-2006 , 04:09 PM
JDigital's Avatar
Registered User
Join Date: Mar 2005
Location: Salt Lake City, UT U.S.A.
Posts: 160
Skywola I think it is great that you are willing to help people out like that. I would really like to learn the coding, it is something I am very interested in and I am just scratching the surface.

I would like to read anything you have on the subject, I know it would be really helpful.

# 15 08-03-2006 , 04:58 PM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
I browsed through several tuts on MEL and found that "The MEL Companion" is a REAL good starting point. I read it until chapter 3 (starting to practice scripting) at once. allthough it is theory it is highly comprehensible and gave me a basic understanding in the contexts of this scripting language.


everything starts and ends in the right place at the right time.
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads