Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
102 views54 pages

Intro To Animation - Maya

The document provides an overview of 3D animation in Autodesk Maya, including modeling, rigging, animation, texturing, and linking motion capture data to animations. It discusses purchasing or making 3D models, creating skeletons to constrain models, setting keyframes to define movement over time, applying textures, and using a script to link CSV motion data to drive a 3D animation. The document includes tutorials and resources for learning 3D animation workflows in Maya.

Uploaded by

Carlos Sanchez
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)
102 views54 pages

Intro To Animation - Maya

The document provides an overview of 3D animation in Autodesk Maya, including modeling, rigging, animation, texturing, and linking motion capture data to animations. It discusses purchasing or making 3D models, creating skeletons to constrain models, setting keyframes to define movement over time, applying textures, and using a script to link CSV motion data to drive a 3D animation. The document includes tutorials and resources for learning 3D animation workflows in Maya.

Uploaded by

Carlos Sanchez
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/ 54

Part 3: 3D Animation in Autodesk MAYA

Intro to Animation
for Science Communication

Jessica Kendall-Bar
Key words and concepts:
Last week’s AFTER EFFECTS WORKSHOP review Design:
• Animation
• Motion Graphics

Shortcuts and Tools:


• Defining Animation v. Motion Graphics •

Duplicate
Align
• Add Keyframes

• Adobe workflows: choosing software to fit your needs •



Add Slider Controls
Using expressions
• Using the Pick Whip

• After Effects Animation Examples


• Tutorial Linking CSV data to After Effects Animations
• Take home practice: syncing timeseries data to videos
Where You’re at :
Your self-described experience level in Autodesk MAYA
60

51
50
# of people

40

30

20

10
8
2
0
None Some Intermediate
3D Animation workflow

Model Rig Animate Texture Lights, Render


Create 3 Rig a skeleton to Animate the Wrap models in Camera, Once your 3D
dimensional constrain and position and UV textures to Action! scene is ready,
direct motion of rotation of your add color and render high
models using your model model or its detail. Add lighting, add resolution 2D
polygon during skeleton over and animate images for each
primitives animation. time. cameras. frame.
Disclaimer: experts specialize in each of these fields as professions, don’t be discouraged if these steps are hard,
because they are! This broad overview is just to give you a sense of what’s possible in the 3D realm!
3D Modeling
Creating a 3D character for your 3D animation using 3D shapes and surfaces.
Option 1) purchase a 3d Model
A 3D model I purchased from:
Websites: Turbosquid, Sketchfab, CGTrader, etc! https://www.turbosquid.com/3d-models/3d-humpback-whale-hump/597221
Option 1) purchase a 3d Model
A 3D model I purchased from:
Websites: Turbosquid, Sketchfab, CGTrader, etc! https://www.turbosquid.com/3d-models/3d-humpback-whale-hump/597221
Option 2) Download a free 3d model
Websites: Turbosquid, Sketchfab, CGTrader, etc!
Free model I made:
https://skfb.ly/6WSIz

For this workshop, feel free to


download and use a 3D model I
modified from a free 3D model of
a harp seal using photos and
measurements of a juvenile
elephant seal.
option 3) make your own from scratch!
Create and edit 3D
shapes to create the
outer mesh of your
3D model.
option 3) make your own from scratch!

Make spheres, cubes, Bevel


cylinders, cones, donuts, Mirror Smooth Extrude
planes or discs.

Vertex mode Face mode Object mode Edge mode


Change selection mode by
right clicking, holding, and
toggling selection modes:
option 3) make your own from scratch!
To achieve smooth organic shapes, you can use the sculpting tools.
Some wild stuff
Entering virtual reality to use Oculus medium to sculpt characters!

https://youtu.be/qmuwXr3bNBY
Rigging
Creating a skeleton to constrain the motion of your 3D model.
RIGGING
Create joints and
bones so that your
3D model’s motion is
constrained.
RIGGING
Can create controls
for each joint to more
easily manipulate
joints.
Animation
Creating keyframes to define the position and rotation of each object (including controls within a skeleton rig) over time
Animation
Set keyframes to define
the position and rotation
of your character and
each of its joints.
Texture
Export UVs, paint and
create textures, and
then apply those to
your 3D model.
Texture
More complex example:
Tutorial
Linking CSV Motion Data to 3D Animation

Using sample dataset that can be found under Autodesk Maya Tutorial Resources at jessiekb.com/resources passcode ucsc
1. Download & store 3d model
Find a free 3D model online with an .obj download option.
Can’t decide on one? Download my free 3D seal here:
https://skfb.ly/6WSIz

File organization in MAYA


Put your seal .obj and .mtl files here
Documents > maya > projects > default > assets

Folder created by default We will use default


Where you store different projects
2. Import 3d model
3. RENAME YOUR MODEL
Select your object in the outliner or by clicking on it (making sure you are in object mode).
In the Outliner, press Enter and type in the new name of your model.
4. Save your scene
File organization in MAYA
Put your scenes here:
Documents > maya > projects > default > scenes
5. Open script editor
Script
output/errors
Save your script!

File > Save Script…

Save in:
The script editor in Maya uses the default > scripts
coding language Python. Don’t be
afraid if you are not familiar- we will Your script goes here
go over the code step by step.
6. Understanding 3D data
Seconds pitch_deg roll_deg head_deg x_position z_position Depth (y_pos)

z
Typical
Accelerometer Axes

y
x
6. Understanding 3D data
Seconds pitch_deg roll_deg head_deg x_position z_position Depth (y_pos)

y
Default
Maya Axes

z (y and z switched so vertical direction is y)


Don’t ask me y!

x
accel Maya y_position on Depth (vertical

6. Understanding 3D data accelerometer,


translates to z
position in Maya
position) is
associated with y
direction in Maya

Seconds pitch_deg roll_deg head_deg x_position z_position Depth (y_pos)

Pitch = 0°
Roll = 0°
Heading = 0°
accel Maya y_position on Depth (vertical

6. Understanding 3D data accelerometer,


translates to z
position in Maya
position) is
associated with y
direction in Maya

Seconds pitch_deg roll_deg head_deg x_position z_position Depth (y_pos)

Pitch = 45°
Roll = 0°
pitch
Heading = 0°
accel Maya y_position on Depth (vertical

6. Understanding 3D data accelerometer,


translates to z
position in Maya
position) is
associated with y
direction in Maya

Seconds pitch_deg roll_deg head_deg x_position z_position Depth (y_pos)

Pitch = -45°
Roll = 0°
pitch
Heading = 0°
accel Maya y_position on Depth (vertical

6. Understanding 3D data accelerometer,


translates to z
position in Maya
position) is
associated with y
direction in Maya

Seconds pitch_deg roll_deg head_deg x_position z_position Depth (y_pos)

Pitch = 0°
Roll = 0°
roll
pitch
Heading = 0°
accel Maya y_position on Depth (vertical

6. Understanding 3D data accelerometer,


translates to z
position in Maya
position) is
associated with y
direction in Maya

Seconds pitch_deg roll_deg head_deg x_position z_position Depth (y_pos)

Pitch = 0°
Roll = 90°
roll
pitch
Heading = 0°
accel Maya y_position on Depth (vertical

6. Understanding 3D data accelerometer,


translates to z
position in Maya
position) is
associated with y
direction in Maya

Seconds pitch_deg roll_deg head_deg x_position z_position Depth (y_pos)

Pitch = 0°
Roll = 180°
roll
pitch
Heading = 0°
accel Maya y_position on Depth (vertical

6. Understanding 3D data accelerometer,


translates to z
position in Maya
position) is
associated with y
direction in Maya

Seconds pitch_deg roll_deg head_deg x_position z_position Depth (y_pos)

Pitch = 0°
Roll = 0°
roll
pitch
Heading = 0°
accel Maya y_position on Depth (vertical

6. Understanding 3D data accelerometer,


translates to z
position in Maya
position) is
associated with y
direction in Maya

Seconds pitch_deg roll_deg head_deg x_position z_position Depth (y_pos)

heading

Pitch = 0°
Roll = 0°
roll
pitch
Heading = -45°
accel Maya y_position on Depth (vertical

6. Understanding 3D data accelerometer,


translates to z
position in Maya
position) is
associated with y
direction in Maya

Seconds pitch_deg roll_deg head_deg x_position z_position Depth (y_pos)

0 0 0
10 Hz 0 -40 0 0 0 0 0
sampling rate 0.1 -40 0 0 0 1 -1
(10 samples
-40° 0° 0°
0.2 -40 0 0 meters left/right 0 2 -2
per second) 0.3 -40 0 0 0 3 -3
0.4 -40 0 0 0 4 -4
0.5 Pitching body -40 Rolling body 0 Pointing body 0 0 5 -5
0.6 40 degrees -40 0 degrees to 0 0 degrees to 0 0 6 -6
0 below horizon -40 either side 0 the right or left 0 0 0 0
0.1 -40 (not rolled 0 (12 o’clock 0 0 1 -1
0.2 -40 over) 0 position) 0 0 2 -2
… … … … … … …

46 -40
4.4 -6 0 0 0 44 -39.9
4.5 -4 0 0 0 45 -40
4.6 -2 0 0 0 meters forward 46 meters down -40
4.7 0 on belly 0 0 0 46 -40
4.8 0 (prone) 0 0 0 46 -40
4.9
5
5.1
0
0
0
0° 0
0
2
0
0
0
0
0
0
46
46
46
-40
-40
-40
5.2 0 4 0 0 46 -40
5.3 0 6 0 0 46 -40
… … … … … … …
13.7 0 174 0 0 46 -40
13.8 0 176 0 0 46 -40
13.9
14
14.1
0
0 180°
0 upside down
178
180
180
0
0
0
0
0
0
46
46
46
-40
-40
-40
(supine)
import csv
import pymel.core as pm

#Defining variables which will be used as column indices (can check these in ‘Sample Seal Data

7. Add YOUR CODE


Headers.csv’)
SECONDS = 0
PITCH_DEG = 1
ROLL_DEG = 2
HEAD_DEG = 3
X_POS = 4
Z_POS = 5
DEPTH = 6

This code is in Python. You can find this script (“Seal Sample
#Defining two variables which will be used as indices where animation starts and ends
START = 0 #start time in sec
END = 12 #end time in sec

Data Input Code.py”) in the Google Drive resources at fs = 10 #Sample frequency (in Hz or "samples per second")

jessiekb.com/resources passcode ucsc


#Reading in .csv file (update to reflect your own path)
with open('C:/Users/jmkb9/Pictures/Art/Workshops/Sample Seal Data.csv') as csv_file:
data = csv.reader(csv_file, delimiter=',')

#For loop runs through all rows in data .csv file


for i, row in enumerate(data):

It reads in your Sample 3D data from a CSV (Sample Seal


if i % 10000 == 0:
print 'Processing row %s' % (i)
#If the row number is between the start and end indices of where we want to animate, run this.

Data.csv) and sets position and rotation keyframes for each


if i >= START*fs and i < END*fs:

#We will use the function float() to return floating point numbers (with decimals) for data values

datapoint. Replace the directory for the CSV file to reflect


time = float(i) / fs - START #Translate .csv data time into animation time
time = time * 24 #Get from frames to seconds

where it is stored on your computer and you should be to go!


translateX_value = float(row[X_POS])
translateZ_value = float(row[Z_POS]) #fixed in newest version of model so don’t need -
depth_value = float(row[DEPTH])

Press CTRL + ENTER to run your code. pitch_value = -float(row[PITCH_DEG]) #add negative to fix orientation
head_value = float(row[HEAD_DEG])
roll_value = float(row[ROLL_DEG])

#Define which object will be transformed according to data (use name as described in "Outliner")
object = pm.ls('elephantseal')[0]

#..setKey function sets a keyframe of the given value at the given time.
object.translateX.setKey(value=translateX_value, time=time)
object.translateZ.setKey(value=translateZ_value, time=time)
object.translateY.setKey(value=depth_value, time=time)

object.rotateX.setKey(value=pitch_value, time=time)
object.rotateY.setKey(value=head_value, time=time)
object.rotateZ.setKey(value=roll_value, time=time)

print 'setting y= %s msw, x= %s, z= %s, rotX= %s, rotY= %s, rotZ = %s for time= %s frames' %
(depth_value , translateX_value , translateZ_value , pitch_value , head_value , roll_value , time)
Change to “Animation” workspace and then use ALT + V to toggle play/pause.

8. preview animation
Scrub forward and backward using the yellow playhead in the
Graph Editor (Windows>Animation Editors>Graph Editor)

The code will have added many (120 in our case) red
keyframes into the timeline, evenly spaced over 12 seconds
(286 frames).
9. smooth animation
If the motion from your data is too choppy, you can
reduce the number of keyframes by opening
“Simplify Curve” options by clicking on the small box
to the right of the option in the Curves menu.
10. PLAYBLAST
You can export a quick, low resolution preview of
your animation by going to Windows>Playblast
11. Scale your scene 12. Texture your seal
Make sure that the size of your character makes We don’t have a detailed texture to add here so we’ll
sense in relation to the size of the scene. In my just add a solid color. Right click and hold on the
case, I found that downscaling my elephant seal by elephant seal object, scroll down to “Assign Favorite
50% (Scale to 0.5 in 3 dimensions) makes it the Material”, and select the “Lambert” material.
right size compared to a max depth of 40 meters.

Rename

Recolor
13. Add some water
Create a plane and scale it up to 500 x 500 x 500
(don’t ask me why there is a y [vertical] dimension to a plane!)
17. Open up a render preview If you press the red play button
to preview the scene, you’ll see
that you get an error message,
saying there is no light in the
scene. So let’s add one!

18. Create a light 19. Press play now


You’ve added a white light
20. Create node that comes from all directions.
This opens a link from the
You can see the ocean plane
color of the SkyDome Light with no texture.
to….
21. Link render node to color ramp
This step links the color of the
SkyDome Light to this color
gradient or “ramp”.
22. Press play AGAIN
Now you have a blue sky around your scene. Next, we
need to make the ocean look good!

You’ve added a white light


that comes from all directions.

You can see the ocean plane


Any issues? Make sure your Renderer under Arnold>Render
with no texture.
is set to “Arnold Renderer”, refresh if needed.
23. ASSIGN ocean texture
Assign a new material to the plane by right clicking and holding, scrolling down to “Assign
New Material…” and then select aiStandardSurface from the Arnold > Shader menu (see right)
24. Another method
Open the “Hypershade Editor”

In the “Create” menu in the


bottom left, navigate to
Arnold>Shader> and click on
“aiStandardSurface” to create a
new texture. It will be added
to the “Node Editor” to the
right, where you can visualize
each linked node of your
texture.
Rename this texture to
“Ocean Surface”
25. Customize ocean surface texture
26. Press play AGAIN
Now your ocean is transparent!
Pan around your scene in persp view to see the scene.
Make the ocean transparent,
but reflective, by increasing
Transmission Weight to 1 and
keeping Specular Weight as is.
27. Customize ocean surface texture
1

This opens a link from the


2 displacement of this texture
shader to….
a file:
28. Open the file node
1 2

Then open the first .exr image of the


Ocean Texture Images folder

Remove link from Displacement to Out


Alpha and Create one from Vector
Displacement to Out Color.
29. Adjust texture scale

2
1
Change “Repeat UV” values
to 10 from 1.
30. Loop displacement map textures
2

4 (right click)

3
1

6 Enter this expression:

File2.frameExtensions=((frame%120)+1);
31. Render your scene
Navigate to Rendering Menu Set and open Render Sequence settings.
1
2
4
Important! Otherwise
will only render 1
frame.

Save somewhere! Arrange your perspective view so that the seal is in


view the whole time. You can also use an animated
camera but for our purposes this will be fine.
4 Drag and drop footage into timeline.
32. Make a video with your sequence
1 Open Adobe After Effects 3 Navigate to where you’ve
(now free for UCSC students) saved your exported exr
2 Right click in the project image sequence and
panel to Import a file. import that image
sequence

5 Export your video in File > Export >


Add to Adobe Media Encoder Queue..

Change settings here Change destination file here Render!


33. Admire your output

You might also like