nCloth Shirt

 
 
 

This example will show you how to use nCloth to simulate a buttoned shirt.

Buttoning the shirt together

The goal of this example is to button the two flaps of the shirt together rather than let them hang loose.

To template the buttons

  1. Select Window > Outliner.

    Maya displays the Outliner.

  2. In the Outliner window select hairSystem1Follicles.
  3. In the main menu select Display > Object Display > Template.

    The buttons change to a wireframe display. If you click on them you will be unable to select them. This will be helpful when you need to select specific vertices when buttoning the shirt together.

To button the two sides of the shirt together

  1. Go to the beginning of the playback range.
  2. -click the shirt and select Vertex from the marking menu that appears.

    Maya displays the vertices of the nCloth.

  3. Select the vertex directly underneath one of the buttons on the shirt and -click the nearest vertex on the flap underneath to include it in the selection.
    Note

    If you have trouble selecting the two vertices as described, you can change the display mode to Wireframe (hotkey: 4) to make the selection process easier.

  4. Select nConstraint > Component to Component.
  5. In the Attribute Editor, select the DynamicConstraint1 tab.
  6. In the Dynamic Constraint Attributes section set Constraint Method to Rubber Band.
  7. Select nCache > Create New Cache.

    Maya automatically plays back the nCloth simulation and saves it to disk as a cache.

  8. Playback the simulation.

    The shirt now falls loosely over the body, but the two flaps remain fastened to one another at the button which you constrained.

  9. Go to the beginning of the playback range.
  10. Select Window > Outliner.

    Maya displays the Outliner window.

  11. In the Outliner window, select DynamicConstraint1.
  12. Press to delete the constraint.
  13. -click the shirt and select Vertex from the marking menu that appears.
  14. -click each vertex underneath each button as well as each respective closest vertex on the flap underneath just as you did for the third button in steps 3 and 4.
  15. Select nConstraint > Component to Component.
  16. In the Dynamic Constraint Attributes section, set Constraint Method to Rubber Band.
  17. In the Outliner window, select hairSystem1Follicles and then select Display > Object Display > Untemplate.

    The buttons will become visible again in the scene view.

  18. Select nCache > Create New Cache.

    Maya automatically plays back the nCloth simulation and saves it to disk as a cache.

  19. Playback the simulation.

    The two shirt flaps remain together at each button.

Improve the shirt's behavior

While the shirt is now buttoned together, you will notice that the overall look of the cloth is still not correct. The cloth appears to stretch too much and at some points and the two flaps pass through one another. You now need to make some adjustments to fix this.

To enhance the appearance of the nCloth shirt

  1. Go to the beginning of the playback range.
  2. Select the shirt.
  3. In the Attribute Editor, select nClothShape1.
  4. In the Collisions section, set the attributes as follows:
    • Self Collision Flag: VertexFace
    • Self Collide Width Scale: 1
    • Thickness: 0.017
  5. In the Dynamic Properties section, set the attributes as follows:
    • Stretch Resistance: 100
    • Compression Resistance: 40
    • Bend Resistance: 1
  6. Select nCache > Create New Cache.

    Maya automatically plays back the nCloth simulation and saves it to disk as a cache.

  7. Playback the simulation.

    The two flaps of the shirt now collide with one another correctly without passing through each other.

Painting the shirt's properties

You may notice that although the collisions are now correct, some parts of the shirt still do not react like real cloth would. Most notably, the collar and cuffs appear too loose, where on a real shirt they would be stiff. You can fix this by painting vertex properties.

To stiffen the collar and front flap

  1. Go to the beginning of the playback range.
  2. Select the shirt and then select nMesh > Paint Vertex Properties > Input Attract.

    The cursor changes to an artisan brush.

  3. Open the Tool Editor.
  4. Adjust the tool settings as follows:
    • Radius(U): 0.3
    • Radius(V): 0.3
    • Value: 0
  5. Click Flood.

    The entire shirt is flooded black indicating no attraction to the input mesh.

  6. Set Value to 1.
  7. Using the artisan brush, paint the collar of the shirt.
  8. Set Value to 0.2.
  9. Using the artisan brush, paint the cuffs of the shirt.
  10. Select nCache > Create New Cache.

    Maya automatically plays back the nCloth simulation and saves it to disk as a cache.

  11. Playback the simulation.

    The collar now remains completely stiff, and the cuffs hang slightly, yet maintain their shape.

Improve the appearance of the shirt

To smooth the look of the shirt

  1. Go to the beginning of the playback range.
  2. Select the shirt.
  3. In the Polygons menu set select Mesh > Smooth.
  4. In the nDynamics menu set select nCache > Create New Cache.

    Maya automatically plays back the nCloth simulation and saves it to disk as a cache.

  5. Playback the simulation.

The shirt is more malleable and flows like real cloth.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License