View Full Version : Channel Control from MEL

03 March 2003, 05:07 PM
How can I access Channel Control features from MEL...

I want to remove the Scale from being Keyable, but when I do what I want to do in the Channel Control, I get the following code in the Script Editor:

disable KEYABLE_Button; disable -v false LockingKeyable|LKtabs|Keyable|containerForm|NONKEYABLE_Button;textScrollList -e -da NONKEYABLE_List;
// Result: NONKEYABLE_List //
PS_moveToNonKeyable Keyable RightFootControl;

Now, that mentions the object that I am working on (RightFootControl), but not the channel that I am changing....

I can't find anything in the help docs on 'PS_moveToNotKeyable', and 'disable' is something to do with ELF....

Anyone know how I can do this? I'm trying to automate a load of stuff in MEL, and it would be ideal to be able to do this there, too...


03 March 2003, 05:53 PM
If you want to make an object's scale non-keyable, just use setAttr -k:

setAttr -k off <object>.sx;
setAttr -k off <object>.sy;
setAttr -k off <object>.sz;

If you have keys on the object's scale and you want to lock them so that they can't be modified, use setAttr -l:

setAttr -l on <object>.sx;
setAttr -l on <object>.sy;
setAttr -l on <object>.sz;

Hope that helps.

Incidentally, this is why using "Show All Commands" is a pain in the ass -- because what Maya triggers when you do something in the interface is usually some MEL that runs some more MEL that runs some more MEL that eventually does what you're trying to do.

If you're trying to figure out what a particular command is, try using the whatIs command:

whatIs PS_moveToNotKeyable

This will tell you whether the thing that Maya's doing is a built-in command or is a MEL procedure, and if it's a MEL procedure it will tell you in what file it's defined so that you can look it up.

There's some more detail in "MEL Scripting for Maya Animators" on how to interpret what you see when you use "Show All Commands" in the script editor, but this should get you started.

-- Mark

03 March 2003, 07:35 PM
great - thanks for that!

I was looking at your book a couple of days ago, seriously thinking about getting it - however, I've been programming for 4 years or so, and don't want to find that most of it is teaching stuff that I already know...

I am looking at David Gould's book, as it seems to be a lot more in-depth, and for people who have a significant amount of programming experience already.....

03 March 2003, 07:42 PM
I am looking at David Gould's book, as it seems to be a lot more in-depth

David's coverage is more in-depth in some areas and less in others.

Our book does spend a little more time on basic programming concepts, but it's worth noting that much of that basic material is specific to Maya and Maya's implementation of a C-like language, so most of it would be new to you even though you have experience programming in other languages. The exceptions might be the discussions of scoping, data typing, and procedures, but since each of these discussions focus as much on what's unique about Maya's implementation as on concepts with which you'd already be familiar, you'll probably end up having to cover that ground anyway.

The main difference between the two books is that ours spends a lot more time talking about actual applications in effects and character animation and David's instead discusses the API.

If your primary goal is to write plug-ins using the API, David's book is the only one to go with between the two.

If you're primarily interested in using MEL casually in the context of effects and character animation, you'll find that ours is a lot more practical.

... and if you're doing MEL tool development you'd probably be best off having both because there's plenty of useful information in each that isn't in the other.

Incidentally, the people who like our book the most seem to be people with programming experience but who have never used MEL. It's usually from those with a heavy MEL background that we get comments like "I wish it went a little faster!"

-- Mark

03 March 2003, 11:28 PM
I think I'm gonna be one of those people who get both ;)

While I do have a lot of programming background, I've been playing with MEL for a few months now, and am happy with it as a language - it's just getting used to the in-built functions, and where to go when I want to do something....

Well, thanks for the advice and comments - now it's just a matter of deciding which to get first (probably yours, as I'm more into MEL at the moment than the API...)

04 April 2003, 01:15 AM
well, I finally bought one of them today....

And it was....



MEL Scripting for Maya Animators....

I decided that, for the moment, your book had more in the way of practical MEL examples, and that I wasn't really going to be delving into the API just yet.

Haven't started reading it yet, but I'm looking forward to.

CGTalk Moderation
01 January 2006, 07: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.