SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.


SM Forums / Maya Questions / Programming / Joint orientation Script

Programming MEL Scripts, Expressions & Programming Related Topics

Join the conversation. Reply to post
Page 1 of 2 1 2
 
Thread Tools
06-03-2006, 10:13 PM   #1
JDigital
Registered User
 
JDigital's Avatar
 
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!
  Reply with quote
06-03-2006, 11:18 PM   #2
vladimirjp
Subscriber
 
vladimirjp's Avatar
 
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
__________________
Image dump
  Reply with quote
07-03-2006, 03:46 AM   #3
JDigital
Registered User
 
JDigital's Avatar
 
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.
  Reply with quote
07-03-2006, 04:18 AM   #4
skywola
Registered User
 
skywola's Avatar
 
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
  Reply with quote
07-03-2006, 04:26 AM   #5
skywola
Registered User
 
skywola's Avatar
 
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
  Reply with quote
07-03-2006, 04:35 AM   #6
JDigital
Registered User
 
JDigital's Avatar
 
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!!!
  Reply with quote
07-03-2006, 04:31 PM   #7
Falott
Registered User
 
Falott's Avatar
 
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.
  Reply with quote
07-03-2006, 04:40 PM   #8
Falott
Registered User
 
Falott's Avatar
 
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.
  Reply with quote
07-03-2006, 04:45 PM   #9
skywola
Registered User
 
skywola's Avatar
 
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
  Reply with quote
08-03-2006, 04:22 AM   #10
JDigital
Registered User
 
JDigital's Avatar
 
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?
  Reply with quote
08-03-2006, 05:43 AM   #11
skywola
Registered User
 
skywola's Avatar
 
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
  Reply with quote
08-03-2006, 09:16 AM   #12
skywola
Registered User
 
skywola's Avatar
 
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
  Reply with quote
08-03-2006, 09:55 AM   #13
Falott
Registered User
 
Falott's Avatar
 
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!

Quote:
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.
  Reply with quote
08-03-2006, 04:09 PM   #14
JDigital
Registered User
 
JDigital's Avatar
 
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.
  Reply with quote
08-03-2006, 04:58 PM   #15
Falott
Registered User
 
Falott's Avatar
 
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.
  Reply with quote
Reply
Page 1 of 2 1 2

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
joint orientation question. cj74 Maya Basics & Newbie Lounge 0 22-07-2015 03:02 PM
One quick question about joint orientation birdiesama Animation 1 21-09-2011 04:14 AM
same animations on duplicate models Tammy Maya Basics & Newbie Lounge 1 07-05-2007 11:52 AM
Joint orientation script problem. GhosTz Maya Basics & Newbie Lounge 0 24-02-2007 04:59 PM
Rig Problem with Rigid Bind mac762 Animation 3 24-06-2006 06:17 AM