Wednesday 11 January 2017

Flag Wave Tutorial in Maya

We've recorded a free "Flag Wave Tutorial" in Autodesk Maya. This is one of our favourite beginner's tutorial - it's the one we often do for our short animation "tasters" here at Escape Studios.  

Starting with no prior knowledge of Maya, students learn how to create a flag, UV map it, and make it wave and flap in the wind.  

Beginner Tutorial - nCloth
Students learn the basic Maya tools and also how to use Maya nCloth - a cloth simulation tool that automates the process.  This video is aimed at complete beginners who have never opened Maya before.

Flag Wave Tutorial
Watch the free Flag Wave Tutorial below:

Lesson Plan
You can also follow the flag wave tutorial step by step, following the steps below:

Goal:  
Learn how to use nCloth in Maya to create a waving flag. 

What You Will Learn
1. Basic Modeling
2. Basic Texturing (do this before you do the nDynamics bit)
3. Basic nDynamics in Maya

Work method:

Modeling: Create a flag
1. Create a project, name it flag, and set to it. 
2. Set Maya to the Modelling menu.
3. Create/polygon primitives/plane/options box
4. Make it flag shaped. Width: 40. Height: 25. Divisions: 40.
5. Position it in your shot above the grid. Name it flag
6. In the inputs tab in the Attribute Editor, make sure you have 40 subdivisions, so that nCloth has lots of vertices to play with.

Texture the Flag 
7. Go to Google images and search for a flag texture map. Find a flag you like (any flag), download it to your sourceimages folder.  Name it flagTextureMap
8. Select the cloth and right click/assign favourite materials/Lambert.
9. Name the Lambert flagMaterial, and in the Attribute editor click on the checker box in the colour tab. Click on file, and search through the yellow file button to find the flagTextureMap. Press 6 on your keyboard and your flag texture map should appear. If it doesn’t, try rendering a frame. Also try pressing the checker football icon on the viewport. Make sure your flag appears.
10. The texture map may not fit correctly yet. To fix this, go to UV/Planar. Now the flag should correctly sit on the geometry. 
11. If it still doesn’t work, try UV/Automatic. You can grab the square manipulator handles and move them around until the image sits properly on the geometry. 
12.  If this doesn't work, go to UV/UV editor, use the scale and move tools to manipulate the UVs until the UVs and the geometry match. 

Create a sky background (Optional)
12. Now create a second plane. Create/polygon primitives/plane. Use the scale tool to make it nice and big. Name it sky, and move it behind the flag. 
13. Go to Google and find a sky image. Save it to your source images folder as skyTextureMap
14. Select sky and right click/assign favourite materials/Lambert.
15. Name the Lambert skyMaterial, and in the Attribute editor click on the checker box in the colour tab. Click on file, and search through the yellow file button to find the skyTextureMap. Press 6 on your keyboard and your sky texture map should appear. If it doesn’t, try rendering a frame. Also try pressing the checker football icon on the viewport. Make sure your flag appears in front of the sky.

nDynamics – make the flag wave
16. Select the FX menu. 
17. Select the flag, go to nCloth/create nCloth. Press play – your flag will now fall down. Why? It has gravity, but no wind. We don’t want this, so we need to fix it. Go back to frame 1.
18. Select the flag and right click for vertex mode. Drag select all the vertices along the top left hand side of the flag. Now go to nConstraint/Transform Contraint. This will hold the flag in place. 
19. Press play again and watch the flag fall, but the left hand side is pinned in place.
20. In the nucleus tab, set wind speed to 30. Press play, and you will see the flag wave in the wind. To change the wind direction, go to wind direction and change z to -2, and you should see the flag change direction. 
21. Play with the settings. Try adding a little (say 0.5) in the Y wind speed. Add 2.5 for wind noise. 

Create a Camera
22. Create/cameras/camera. You now have a basic camera in Maya. Name it shotCamera
23. In your viewport, under the show button, turn on cameras so you can see it. To see through the camera, go to panels/look through selected. You can now position the shotCamera wherever you want. 
24. Once you have the camera in a nice position, lock off the translates and rotates in the Channel Box.

Geo Cache 
25. Now go to the nCache/Create New Cache/nObject and cache out the simulation.
26. Create a new, identical flag, and assign the material to it.
27. Select the new flag, go to Cache/Import Cache… to import the flag animation back into Maya. 
28. You can now delete the original flag with nDynamics.

Rendering – Make a Movie File 
29. Click on render preferences  and check the settings. A window titled render settings should open up.
30. Under “render using” select Maya Hardware 2.0. This will render directly from your computer’s graphics card. 
31. Click on the “common” tab
32. Under File Output/Image Format select AVI (avi) 
33. Set Frame/Animation ext to name.ext (Multi Frame)
34. Set your frame range from . 
35. Under Renderable Cameras set your camera to shotCam.
36. Under Image Size select HD 720
37. Under render settings, check the path (ie where the images will go) to make sure you have set your project correctly. Your rendered images should go into the images folder of the current project.
38. Instead of the Animation menu (top left) switch to Render menu 
39. Go to render/batch render/options. Use all available processors, hit batch render and close.
40. Maya will start rendering your frames. Your avi file should show up in your images folder. 
41. Finally, upload your movie file to your YouTube channel.

Tutorial
You can find the tutorial here:

FX Tutorials
To see more FX tutorials at Escape Studios, follow this link to our Vimeo Tutorial Channel.

The Escape Studios Animation Blog offers a personal view on the art of animation and visual effects. To find out more about our BA/MArt, follow this link.   To apply, visit the official page here.

No comments:

Post a Comment