Demystifying Cloth in Maya

By Brian J. Immel

This tutorial covers the basics of creating a shirt using Maya cloth. This tutorial requires Maya Unlimited version 5 through 8.5.

 

Outlining the Shirt

1. In one of the orthographic views, create these curves according to the image below.

2. Select all the curves and duplicate them. With the new set of curves still selected, pull them forward about 2 units (Translate Z=2). This set will be used to create the front of the shirt. Add another curve to make the collar opening and delete the curves that cross the collar.

3. Select the curves for the backside and put them in a layer and hide them for now and name the layer backside_curves. Select the front curves and put them in a layer called frontside_curves.

Top

 

Creating the Panels

1. Next we're going to create the panels. Each panel must be created with a closed loop but cannot use the same curve twice. Duplicate the curve between the sleeve and the armpit (Figure 4). Select the four curves that make up the sleeve and in the Cloth menu select Create Panel (Figure 5).

2. After you create the panel, name it panel_FR_sleeve. The channel box lists only one attribute called Resolution Factor for the panel_FR_sleeve. Keep this guy in mind later on when we deal with cloth resolution issues.

3. Continue on creating panels and naming each one. Remember not to use a curve that was used previously for another panel. If you're not sure if a curve was already used, select it. If a panel turns pink, then that means that curve is being used for that panel and you need to duplicate the curve (Figure 6). Once you have finished creating all five panels (panel_FR_sleeve, panel_FR_armpit, panel_F_torso, panel_FL_sleeve, panel_FL_armpit) you should have something that looks like Figure 7.

4. Select all the panels and put them in a layer called panels and hide it for now.

5. Unhide the backside_curves layer and hide the frontside_curves layer and repeat steps 4-7. Name each panel with the panel_B... instead of panel_F.... I use these naming conventions for back (B) and front (F).

6. Unhide the panels layer. So far we should have something that looks like Figure 8.

Top

 

From Panels to a Garment

1. Select a panel and hit Create Garment. Repeat this step until all panels have garments.

2. In Figure 9, you see that there are several INPUTS in the Channel Box called cpSolver1, time1 and ten cpStitchers.

3. Our next task is to connect all these individual cloth objects into one piece. This is done by creating seams. Seams are created by selecting the curves that are next to each other as I mentioned earlier in step 1. Select the two curves (that are sitting on top of each other) between the FR_sleeve and the FR_armpit and hit Create Seam. Name each seam as you create them (seam_FR_sleeve, seam_FR_armpit, seam_FL_sleeve, seam_FL_armpit).

4. Now we should be ready to close up those darts. Select the two curves that make up the ‘hole’ and Create Seam.

5. Next select each curve on the front and back sets and create seams between them to close off the cloth object. This step will take a few tries depending on the order you seam it shut. Once completed, your shirt should look something like Figure 10. Name the cloth object Shirt.

6. Next I should talk about creasing the seams. Each seam has two attributes: Crease Angle and Crease Stiffness. Crease Angle creates the look of two pieces of cloth sewn together. The values to use for Crease Angle should be between –180 and 180. Adjusting the Crease Angle lets you control more likes on the cloth object like lapels. Crease Stiffness tells the seam how much to resist being pulled flat. For the darts on both front and back, I used a Crease Stiffness value of 0.5. For the sleeve seams I used the Crease Angle of 45 and Crease Stiffness of 1.

7. Change the cpStitcher's Base Resolution to 400.

Top

 

Collision Time!

1. Next create a simple poly body to use a collision object for the Shirt. Refer to Figure 11. Name the polygonal object Cloth_collide. With the Cloth_collide object still select, go Cloth > Create Collision Object. Set the Collision offset to 0.15 and Collision Depth to 0.4.

2. On the shirt, there is an attribute called cpSolver1. In cpSolver1, change the following attributes: Solver Scale = 10 and Relax Frame Length = 1. Relax Frame Length makes the cloth act more rubber-like or gives it bounce.

3. Now we’re ready for the big simulation. Rip off the Simulation panel and leave it open as a floating menu because you'll be going back and forth with testing and running simulation after simulation to get that shirt to fall just right. Go to Simulation and hit Start Simulation. This will start the solver and drape the shirt across the Cloth_collide object. Once the shirt has fallen to a position that looks pretty good, hit Stop Simulation. From here on, you’ll have to tweak the numbers to get the desired results. Every time you make an adjustment to the Shirt or Cloth_collide object, you should delete your Cache (Simulation > Delete Cache). Once you find a simulation that drapes pretty well, hit the Save as Initial Cloth State. This will keep the shirt in the solved pose from here on out.

4. Once you have the shirt simulated just the way you like, you should animate the Cloth_collide object to test the shirt completely. Animate the Cloth_collide object forward, back, up, down and some twisting motions (in other words, all the motions you body may do).

Top

 

Tips on Cloth Animations