Maya TutorialsAbout Us

Turnip: nCloth Simulation for Characters

Valid for: Maya 2009 and above.
Tools used: nCloth.
Goal: Creation and simulation of clothes on a character (here "Turnip" from Hayao Miyazaki's "Howl's Moving Castle").

Overview

In this tutorial we are going to see how to use and setup Maya nCloth to create and animate clothes.

We need:
  • A polygonal model of a character (nCloth works only with polygonal meshes at the moment). This model is important because it will drive the cloth simulation.
  • Recommendations: 
    • The model must not have too many polygons (< 10 000), it's useless to use the high def model with details. It just needs to have the same shape as the high def model.
    • Work with a T-pose model, it'll be much more easy to model your clothes


For "Turnip" the modeling is quite simple :
  1. 2 polygonals cylinders for the woody T-shape.
  2. 2 more p.c. for the pip.
  3. A polygonal sphere for the head.
  4. For the hat you can use "Surface->Revolve" with an EP-Curve.
  5. The top of the hat is a nurbs circle with "Surface->Planar" function applied on it.
  6. Turnip's chest has been created with:
    1. "Mesh->Create Polygon Tool" to create the shape.
    2. "Edit Mesh->Split Polygon Tool" to create internal edges.
    3. "Edit Mesh->Extrude" to give some thickness.

Clothes modeling:

We are going to model 2 pieces of cloth for Turnip's trousers and coat.

  1. Trousers modeling:
    1. Create the shape of the trousers in the front view with "Mesh->Create Polygon Tool" and add internal edges with "Edit Mesh->Split Polygon Tool".
    2. Duplicate this shape.
    3. Move the vertices to give the first shape a correct volume for the front part of the trousers.
    4. Move the vertices to give the second shape a correct volume for the back part of the trousers.
    5. Select both meshes and apply "Mesh->Combine".
    6. Sew the frontier edges of the combined mesh with "Edit Mesh->MergeEdge Tool" (if there is a collapse during this process it's because the normals of one part of the combined mesh are reversed. To solve this
      a) undo the combine
      b) display normals on both meshes (select the mesh "Display ->Polygon->Face Normals" to undo the display re apply this function)
      c) select the mesh with the flipped normals (you must see the normals inside the mesh or normallly it's outside) and appply "Normals->Reverse").
    7. You must be very carefull with the shape off your trousers, you must not have any inter penetration between it and your character's mesh. It's a good idea to do quite loose trousers to avoid those pbs.
    8. You can apply a "Mesh->Smooth" and a "Edit Mesh->Poke face" on your trousers to improve mesh simulation but it'll increase computing time.
    9. Destroy the construction history of your trousers ("Edit->Delete by Type->History").
    10. That's over for trousers.
  2. Coat modeling : 
The modeling process is exactly the same as for the trousers. You just need to be carefull about inter penetration between your coat and the trousers.





Final result :




NCloth Setup :

Now we have  a full modelised characters with its clothes. We only need to setup a dynamic suimulation for them.

  1. First part define collide objects for the simulation, in our case it will be the chest and the woody T-shape. 
    1. There is a probleme with the vertical cylinder of the T-Shape because it go through the trousers. To solve this we need to create and other cylinder avoiding this pb. Be sure to solve all the possible interpenetration pbs like this one between collision objects and clothes.
    2. We'll use this cylinder instead of the origianl one to compute collision. Parent it with the original one so it'll follow the animation.
    3. Select all the meshes which will collide with your clothes and apply "nMeshes->Create passive collider". In our case we select the chest, the horyzontal part of the T-Shape and the cylinder we create just before.
  2. Now define ncloth objects. For this select all your clothes (in our case the trousers and the coat) and apply "nMesh->Create nCloth".
  3. For cloth like trousers if you launch the simulation now (by playing timeline) you will see it falls to the floor. That's because we need  a blet ^^. To solve this we'll just attach the trousers to the plevis. For this select the trousers, shift select the chest  right click on the trousers and chosse vertex, shift select the top vertex loop of the trousers (corresponding to the belt position) and apply "nConstraint->Point to surface". Now the trousers mustn't fall anymore.
  4. The coat has'nt this problem because the shoulders support it.
  5. Now you have to play with nCloth parameters to improve the simulation. You can check nCloth presets, for this go inside the nClothShape tab of the attribute editor of your cloth (trousers for exemple) and on the top rigth part of the attribute editor window you have a "Preset*" button where you can assign a cloth preset to your cloth (heavy denim is quite a good one). Check the result by playing the time line and tweek parameters to improve the result. It's not easy but with time you can do a quite nice simulation.

Tips :

If you want to tear clothes you can define your clothes as tearable, for this select the cloth mesh and apply "nConstraint->Tearable surface". Be carefull is a quite heavy process in computation time. You have to play with the glew attribute to improve the tear process.
For a good coth simulation you have to play a lot with the nClothShapes attributes it's a quite long process but results are cool:)



Copyright © Olivier Dumas
Tutorial written by Olivier Dumas