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! |
u need to source tghe script first.
or restart maya after install |
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. |
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. |
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. |
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!!! |
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. |
sry!!
I turned the procedure into a global procedure. problem solved! |
Yep. I've made that mistake before . . .
|
I noticed that too, how do you turn it to a global procedure? Is it in the code, or in the maya interface?
|
This is global :
global proc aliasCommands(){ alias q quadSliderWindow; alias w getSliderWindow; }; You just put "global" in front of the procedure declaration. |
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! |
hope you have plenty of time, cause I have a ton to learn about mel..hehe!
Quote:
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. |
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. |
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.
|
All times are GMT. The time now is 04:03 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018