SimplyMaya Forums

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

Home / forum / Animation / Mel Scripts & Programming / Editing Expressions
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 22-03-2006, 09:06 AM   #1
skywola
Registered User
 
skywola's Avatar
 
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
Thanks: 0
Thanked 0 Times in 0 Posts
Default Editing Expressions

To create an expression in MEL, you would do this:

expression -s "ls.rotateY = time;" -o expression1 -ae 1 -uc all ;
// Result: expression1 //

I actually did not code that, I did it in the expression editor and just copied it out of the script editor. . . But it is handy to know how to write the code. If you want to edit an expression after it has already been created, you would do this:

expression -e -s "ls.rotateY = time * 3;" -o expression1 -ae 1 -uc all expression1;
// Result: expression1 //

Note the extra -e in the edit expression code. You also must name the expression which you wish to edit! (expression1).

The usefullness in this coding is very well demonstrated in the Walkerman program as part of the code that controls the ability to toggle the hand control so you can either control all four fingers at once or one finger at a time . . . .
__________________
"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
skywola is offline   Reply With Quote
Old 25-03-2006, 02:01 PM   #2
westiemad
Registered User
 
Join Date: Oct 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I normally keep all my expressions in one place, eg create a locator and add an attribute to it, say DoNotDelete, and set it in the expression to 1.

ExpLocator.DoNotDelete = 1;

then all the other expressions get stuck under this one. Not to everyones tastes perhaps but when you have a lot going on i find it much quicker to scroll than remember the name or where it was.

AnDy
westiemad is offline   Reply With Quote
Old 25-03-2006, 05:36 PM   #3
skywola
Registered User
 
skywola's Avatar
 
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My trick is searching out the string that builds the expression. It is unique, because Maya will not allow you to create two expressions controlling the same attribute like "ls.rotateY". If I need to change an expression in run time, I just search it out and edit it. If I want to see the expression as it appears, I just copy it to the script editor and print it. This is a key method used in the Walkerman program I created, it allows me to change the gaits and control the hands in runtime.
__________________
"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
skywola is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.