# Week 7
1. Preparation for walking cycle
- 1. Preparing body mesh.
- 2. Creating skeleton and control rig using HIK controls editor.
- 3. Skinning and controlling skin weight.
- 4. Image plane.
- 5. Key all.
- 6. Turn on the Auto Key.
- 7. Analyzing and planning your walk animation.
- 8. Test a keyframe animation.
- Review previous practices
# Creating walking animation
- Select the project and save a scene.
### 1. Preparing body mesh
- Import a body mesh
You can find mesh data from [GettingStarted2015LessonData](https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/ENU/123112/files/maya-tutorials-html.html)
Or download a human obj mesh from [here](data/Human.obj). Or you can use your own custom mesh, but make sure that it has enough subdivided spans.
- **Clean up the history and transformations**. If you change or edit your mesh, please delete any history before rigging.
Edit > Delete All by Type > History. Then, select the body and choose **Modify > Freeze Transformations.**
You should find that the transformation value became 0,0,0,0,0,0,1,1,1.
It’s generally very important to have a mesh that is devoid of all history when getting ready to do any rigging or skinning. Deforming a mesh can be a processor-intensive procedure, and if there is other history on the mesh, Maya has to recalculate all those history nodes for every tweak to a skinned joint.
### 2. Creating skeleton and control rig using HIK controls editor.
Check out week 6 class notes.
### 3. Skinning and controlling skin weight
1. Ensure to 'delete history' on the mesh.
2. Choose the mesh and the root of the skeleton, and apply Bind skin. (Recommended option: In the option box of Bind skin, check **Heat Map bind method** and set Max influence to 2.)
3. Check out different poses, and if it is necessary, please edit skin weights.
### 4. Image plane
You can draw or find a reference image for your animation and then import it to your camera view (side).
![ip01](img/lab/walk_p1.png), ![ip02](img/lab/walk_p7.png), ![ip03](img/lab/walk_p13.png), ![ip01](img/lab/walk_p19.png)
### 5. Key all
We will make one cycle of walk animation. Let's select all and set key on the frame '1', '7', '13', '19', and '25'.
We can choose either way to use HIK editor or you can crete a MEL command.
- Using HIK editor
- Or, Create MEL command (you can skip this process)
We can create a custom command using MEL to make a key process simpler.
What to make: the command which can key all necessary controllers.
How to make:
1. Open **the Script Editor**.
2. Shift-select all controllers and set keyframe in the viewport.
3. From the Script Editor (at the bottom right), find the MEL of the command you made and drag it with MM button to the **custom shelf**.
4. From the popup box, select the type as MEL and save.
5. Open the shelf setting (at the top left), check the Command, put the name at the Icon label.
### 6. Turn on the Auto Key
- If you turn on the Auto Key (at the bottom right), all your moves with controllers will be keyed.
The Auto Keyframe feature automatically places keyframes on an object when a change is made to one of its attributes. For Auto Keyframe to work, the attribute must have an existing keyframe. To turn Auto Keyframe on, click the circular arrows icon to the right of the timeline.
***Using Auto Keyframe is a matter of personal preference. While it is very convenient, however, at the same time, you can easily set unwanted keys on an object by mistake when using this feature, so remember to use it with caution.***
### 7. Analyzing and planning your walk animation
- Try to observe and remember walking and research walking related references.
- We can apply [12 Principles of Animation](http://www.cgmeetup.net/home/12-principles-of-animation-by-frank-thomas-and-ollie-johnston/) such as:
- Pose to pose & Straight ahead
- Follow through
- Secondary action
- Squash & Stretch
### 8. Test a keyframe animation
- If there is any error, please redo it until you can fix it.
- Please repeat the processes, until you feel it comfortable.
## Let's practice!