0% found this document useful (0 votes)
38 views24 pages

Maya

This Maya tutorial document provides an overview of the Maya 3D modeling and animation software and introduces some basic concepts and tasks for getting started. It covers adding and manipulating 3D objects, setting keyframe animations by manually specifying attribute values at different times, and using MEL scripting to programmatically create objects and animations. The exercises guide learning how to create simple animations of a sphere and cube moving over time, and provide a project example of modifying linear interpolation between keyframes. Useful links are also included for additional Maya modeling, animation, and MEL scripting reference materials.

Uploaded by

YOHAN KE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views24 pages

Maya

This Maya tutorial document provides an overview of the Maya 3D modeling and animation software and introduces some basic concepts and tasks for getting started. It covers adding and manipulating 3D objects, setting keyframe animations by manually specifying attribute values at different times, and using MEL scripting to programmatically create objects and animations. The exercises guide learning how to create simple animations of a sphere and cube moving over time, and provide a project example of modifying linear interpolation between keyframes. Useful links are also included for additional Maya modeling, animation, and MEL scripting reference materials.

Uploaded by

YOHAN KE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Maya Tutorial

Put together from material at: http://download.autodesk.com/us/maya/Maya_2014_GettingStarted/index.html


Getting your bearings
Adding objects
Scale, rotate and translate objects
Viewing and positioning
Useful points
Can edit properties of an object (its position, its scale, etc) using the channel
box as well as the transformation icons.

Move mouse over a view <perspective, top, front, etc> and press space to have
it occupy the entire workspace. Press space to toggle back to four views.

Can toggle snap to grid to move/scale by integral grid points.

Can press ‘a’ to frame current scene.

And many more that you’ll discover as you use Maya


Exercise
Create a sphere at (0,0,0) of radius 2 and a cube at (4,0,0) of side 1 each
Keyframe Animation
Keyframe Animation Basics
Set a couple of keyframes, where the values of the attributes you want to
interpolate (x position, scale, etc.) are manually specified.

Maya does the interpolation automatically between these keyframes.

Generally 24fps for animations.


Adding a keyframe
Exercise
Add three key-frames to make the box go over the sphere over 2 seconds

Additional stuff - s shortcut to add a keyframe


Viewing the interpolation curve
Useful points
Can edit the interpolation curve in the Graph Editor to tweak animation.

Can goto Windows>Playblast to quickly create a movie for the animation.


MEL <Maya Embedded Language>
scripting
Window > General Editors > Script Editor.

History and script input areas.

Any command performed using the UI invokes a script - try adding a sphere
and deleting it to see the sequence of scripting actions generated.

General syntax: command -<flag> <value> -<flag> <value> ...


MEL scripting basics
Variable types: int, float, string
Aggregate types: array, matrix

Created as: float $myRadius = 10.0;


Matrices: matrix $a[2][2] = <<1,2;3,4>> -- a[0][0] = 1, a[0][1] = 2, a[1][0] = 3...
Arrays: int $myArray[5] = {1,2,3,4,5};
size($myArray) => returns 5
MEL scripting basics
Procedures: proc <return_type> proc_name(arg1, arg2)
Eg: proc myProc1(int $var1, string $var2);
proc string myProc2(int $var1, string $var2);

Calling a proc: myProc 1 name -- all arguments implicitly converted to strings


myProc(1, “name”) -- need to explicitly convert to a string

Loops: for ($i = 0; $i < 10; $i++)


Additional constructs include: switch-case, while, etc -- similar structure to
C++/Java.
print - prints values of variables
Exercise - Add a sphere using MEL
scripting
Create a script to add a sphere to the workspace using MEL scripting using the
following proc signature:

proc addSphere(int $radius)

call the proc to create 2 spheres of radius 3 and 5


Project Bootstrap
Look at the script given in the assignment as an example

Idea -
Query the number of keyframes <keyframe -query -keyframeCount>
Query the time and values at the keyframes <keyFrame -query -
timeChange -valueChange>
Find out linearly interpolated values at each time instance between
successive keyframes
Add these values as keyframes <setKeyframe -time <> -value <> >

Project -
Change the linear interpolation part to other forms of interpolation.
Exercise - Project Bootstrap
Copy the example given in the project description and try to run it <Ctrl+Enter>
from the script editor to have the script stored.

Perform a linear interpolation of the height of the box that is jumping over the
sphere and note the change in the animation curve in the graph editor to
ensure that you’ve switched over to a linear interpolation.
Useful Links
Maya modeling and animation:
http://download.autodesk.com/us/maya/Maya_2014_GettingStarted/index.html - Maya Basics - Lesson 1 to 4, Animation - Lesson 1
particularly helpful for getting up and running.

MEL scripting:
http://download.autodesk.com/global/docs/maya2014/en_us/index.html?url=files/Background_MEL_for_programmers.htm,
topicNumber=d30e788742
http://web.archive.org/web/20111120180214/http://caad.arch.ethz.ch/info/maya/manual/Commands/melCommands/melFAQ.html
Questions?

You might also like