Show in Contents
Add to Favorites
Home: Autodesk Maya Online Help
nCloth Soda Can
nCloth Examples
nCloth attribute presets
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
- Select
Window > Outliner.
Maya displays the Outliner.
- In
the Outliner window select hairSystem1Follicles.
- 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
- Go
to the beginning of the playback range.
- -click
the shirt and select Vertex from the marking menu
that appears.
Maya displays the vertices of the nCloth.
- 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.
NoteIf 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.
- Select
nConstraint > Component to Component.
- In
the Attribute Editor, select the
DynamicConstraint1 tab.
- In
the Dynamic Constraint Attributes section
set Constraint Method to Rubber
Band.
- Select
nCache > Create New Cache.
Maya automatically plays back the nCloth simulation
and saves it to disk as a cache.
- 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.
- Go
to the beginning of the playback range.
- Select
Window > Outliner.
Maya displays the Outliner window.
- In
the Outliner window, select DynamicConstraint1.
- Press to delete
the constraint.
- -click
the shirt and select Vertex from the marking menu
that appears.
- -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.
- Select
nConstraint > Component to Component.
- In
the Dynamic Constraint Attributes section,
set Constraint Method to Rubber
Band.
- In
the Outliner window, select hairSystem1Follicles and then select
Display > Object Display > Untemplate.
The buttons will become visible again in the
scene view.
- Select
nCache > Create New Cache.
Maya automatically plays back the nCloth simulation
and saves it to disk as a cache.
- 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
- Go
to the beginning of the playback range.
- Select
the shirt.
- In
the Attribute Editor, select nClothShape1.
- In
the Collisions section, set the
attributes as follows:
- Self
Collision Flag: VertexFace
- Self
Collide Width Scale: 1
- Thickness:
0.017
- In
the Dynamic Properties section,
set the attributes as follows:
- Stretch
Resistance: 100
- Compression
Resistance: 40
- Bend
Resistance: 1
- Select
nCache > Create New Cache.
Maya automatically plays back the nCloth simulation
and saves it to disk as a cache.
- 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
- Go
to the beginning of the playback range.
- Select
the shirt and then select
nMesh > Paint Vertex Properties > Input Attract.
The cursor changes to an artisan brush.
- Open
the Tool Editor.
- Adjust
the tool settings as follows:
- Radius(U):
0.3
- Radius(V):
0.3
- Value:
0
- Click Flood.
The entire shirt is flooded black indicating
no attraction to the input mesh.
- Set Value to
1.
- Using
the artisan brush, paint the collar of the shirt.
- Set Value to
0.2.
- Using
the artisan brush, paint the cuffs of the shirt.
- Select
nCache > Create New Cache.
Maya automatically plays back the nCloth simulation
and saves it to disk as a cache.
- 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
- Go
to the beginning of the playback range.
- Select
the shirt.
- In
the Polygons menu set select
Mesh > Smooth.
- 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.
- Playback
the simulation.
The shirt is more malleable and flows like real
cloth.