P. 1
Graphics - Maya Learning Book

Graphics - Maya Learning Book

|Views: 64|Likes:
Published by Tiểu Hồ Đồ

More info:

Published by: Tiểu Hồ Đồ on Nov 27, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/20/2013

pdf

text

original

When you write an expression in the Expression Editor, it can be written as a
MEL script. You can also use MEL to create the expressions from within the
Script Editor.
You will create two expressions to control the start and endSweep of the
eyeLidÕs makeNurbSphere input node. In Lesson 6, you used Set Driven Key.
Now you can compare the use of expressions to that earlier approach.

1Add an expression to the eyelid’s startSweep

This expression is designed to make sure that as the blink attribute goes
from 0 to 10, the eyelid rotates 60 degrees. Therefore, the blink attribute is
multiplied by 6.

s

Enter the following:

expression -n toplid -o makeNurbSphere1

Learning Maya 235

Blinking using MEL

Building a blink procedure

P
r
o
j
e
c
t
O
n
e

-s “ssw = eyeControl.blink * 6” < enter >

2Add an expression to the eyelid’s endSweep

This expression is similar to the last one except now you want the
eyelid to rotate from 360 to 300 degrees. Therefore the blink attribute is
multiplied by 6 then subtracted from 360.

s

Enter the following:

expression -n bottomlid -o makeNurbSphere1

-s “esw = (360 - eyeControl.blink * 6)” < enter >

3Test the blink attribute

s

Enter the following:

setAttr “eyeControl.blink” 5 < enter >

4Set keys on the blink attribute

s

Enter the following:

setKeyframe -at blink -t 1 -v 10 eyeControl;

setKeyframe -at blink -t 5 -v 0 eyeControl;

setKeyframe -at blink -t 10 -v 10 eyeControl < enter >

The short flag names represent the following:

-at

attribute that is being keyed

-t

time at which you want the key set

-v

value of the attribute that you want to key

s

Playback the results.
Keys have been set at several frames with the eye opening and
closing to match.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->