N Cloth Tutorial
N Cloth Tutorial
N Cloth Tutorial
nCloth
Introduction
With the Maya nCloth feature, you can create dynamic cloth effects in Maya.
nCloth is a fast and stable dynamic cloth solution that uses a system of linked
particles to simulate a wide variety of dynamic polygon surfaces, such as fabric
clothing, inflating balloons, shattering surfaces, and deformable objects. nCloth is
generated from modeled polygon meshes. You can model any type of polygon
mesh and make it an nCloth object, which is ideal for achieving specific poses
and maintaining directorial control.
nCloth is built on a dynamic simulation framework called Maya Nucleus. A
Maya Nucleus system is composed of a series of nCloth objects, passive
collision objects, dynamic constraints, and a Maya Nucleus solver. As part of the
Maya Nucleus system, the Maya Nucleus solver calculates nCloth simulation,
collisions, and constraints in an iterative manner, improving the simulation after
each iteration, to produce accurate cloth behavior.
5 | nCloth
> Preparing for the lessons
Maya Unlimited provides many predefined nCloths. These sample nCloth objects,
also referred to as presets, can be used as a starting point in creating your own
custom cloth effects.
This chapter includes these lessons:
Select the nCloth menu set. Unless otherwise noted, the directions in this
chapter for making menu selections assume youve already selected the
nCloth menu set.
5 | nCloth
> Introduction
Lesson 1
Introduction
For nCloth objects to have realistic cloth behavior, they need to interact or collide
with their environment. This is accomplished by converting the meshes you want
to act like cloth into nCloth objects, and turning all the objects in their
environment that it will come into contact with into passive collision objects.
In this lesson you learn how to:
5 | nCloth
> Lesson setup
Lesson setup
To ensure the lesson works as described, do these steps before beginning:
1
You can open the scene named TableCloth.mb from the Maya DVD or from
the drive where you copied the Getting Started with Maya Unlimited data
files. The file is located in UnlimitedLessonData/nCloth.
This scene includes textured models that have been created for you. The
table cloth, table, table base, floor, and wall models provided are all polygon
meshes.
The first step in the nCloth creation process is to convert the polygon object you
want to behave like cloth to an nCloth object.
To make a polygon mesh nCloth
1
5 | nCloth
> Creating an nCloth object
5 | nCloth
> Creating an nCloth object
Select Window > Hypergraph: Connections to view the new node connections
for the table cloth in the Dependency Graph (DG).
The Hypergraph appears with a new Maya Nucleus network of nodes. Note
that the table cloth is now a member of the nucleus1 Maya Nucleus system.
nClothShape1 is the nCloth properties node, which carries all the nCloth
attributes for the table cloth.
nucleus1 is the Maya Nucleus solver node, which carries all the attributes
affecting the nucleus1 solver system, including internal forces.
5 | nCloth
> Making an nCloth collide with its environment
TableClothShape is the input mesh and start object for the table cloth.
outputCloth1 is the output mesh or current mesh, and the resulting nCloth
table cloth that you see in the scene view.
polyPlane2 is the history node for the table cloth.
7
Close the Hypergraph and play back your table cloths simulation.
The table cloth passes right through the table, its base, and the floor. This is
because the nCloth does not recognize any of the other objects in your
scene. For the nCloth table cloth to be able to interact with the table, its
base, and the floor, they need to be members of the same Maya Nucleus
solver system as the table cloth.
Table cloths
simulation without
collisions.
5 | nCloth
> Making an nCloth collide with its environment
Select nucleus1 from the Solver drop-down list and click Make Collide.
The table polygon mesh is converted to a passive collision object, and an
nRigid handle appears at the center of its mesh in the scene view. You can
use the tables nRigid handle to quickly select its nRigidShape node in the
Hypergraph or its tab in the Attribute Editor.
Table as viewed in
X-Ray Shading
mode.
Like the nCloth
handle, the nRigid
handle resembles a
small wireframe
sphere, and it is
located at the
center of table.
The table is also now a member of the nucleus1 Maya Nucleus system.
4
Select Window > Hypergraph: Connections to view the new node connections
for the table in the Dependency Graph (DG).
5 | nCloth
> Making an nCloth collide with its environment
nRigidShape1 is the passive object properties node which carries all the
passive object attributes for the table.
5
Close the Hypergraph and play back your table cloths simulation.
The table cloth now collides with the table. The table cloth now interacts with
the table because the table is a member of the table cloths nucleus1 solver
system.
Table cloths
simulation with
passive object
collisions.
5 | nCloth
> Adjusting the accuracy of nCloth collisions
In the Surface Properties section, select Collision Thickness from the Solver
Display drop-down list.
5 | nCloth
> Adjusting the accuracy of nCloth collisions
5 | nCloth
> Adjusting the accuracy of nCloth collisions
5 | nCloth
> Adjusting the accuracy of nCloth collisions
The table cloths collision volume is noticeably reduced, so that it will now
behave like a thin piece of fabric rather than a thick surface. This new
Thickness will contribute to improving the accuracy of the table cloths
collisions when it falls onto the table.
6
5 | nCloth
> Adjusting the accuracy of nCloth collisions
Table cloth
Solver Display:
Collision
Thickness
5 | nCloth
> Adjusting the accuracy of nCloth collisions
Even though you adjusted the table cloths Thickness, the table cloth still
does not appear to be making contact with the tables surface. This is
because passive collision objects, like the table, also possess collision
volumes.
To further improve the accuracy of the table cloths collisions, you need to
adjust the tables Thickness.
8
In the scene view select the table, and in the Attribute Editor select its
nRigidShape1 tab.
10 In the Surface Properties section, select Collision Thickness from the Solver
Display drop-down list.
5 | nCloth
> Adjusting the accuracy of nCloth collisions
5 | nCloth
> Adjusting the accuracy of nCloth collisions
The tables collision volume is noticeably reduced, so that the table cloth will
now conform closely to the actual shape of the table when you play back its
simulation.
12 In the Surface Properties section, select Off from the Solver Display dropdown list.
The tables Collision Thickness is no longer displayed in the scene view.
13 Play back the table cloths simulation.
5 | nCloth
> Adjusting the accuracy of nCloth collisions
Table cloths
improved collisions.
5 | nCloth
> Adjusting the accuracy of nCloth collisions
Adjusting the Thickness of the table cloth nCloth and the table passive object
dramatically improved the accuracy of the table cloths collisions.
14 Go to the start of the playback range.
To set which nCloth components participate in collisions
The way Collision Thickness appears in the scene view is determined by your
nCloths current Collision Flag selection. The Collision Flag drop-down list lets you
specify which of the table cloths components participate in its collisions and
which type of collision volume is used by the table cloth. You can adjust the
speed of your nCloth collisions with the Collision Flag at the cost of collision
accuracy.
1
In the Surface Properties section, select Collision Thickness from the Solver
Display drop-down list.
Scroll down to the Quality Settings section of the nClothShape tab and
expand it.
By default, the Collision Flag is set to Face. Face provides the best and most
accurate collisions, but it is the slowest to calculate the collisions for.
5
Change the Collision Flag selection to Vertex. Vertex produces the least
accurate collisions, but it is the fastest to calculate the collisions for.
5 | nCloth
> Adjusting the accuracy of nCloth collisions
The table cloths collision volume changes from a surface to multiple collision
spheres.
6
5 | nCloth
> Adjusting the accuracy of nCloth collisions
Table cloths
simulation with
Vertex Collision
Flag selected.
Vertex and face are useful when you want to speed up your simulation by
reducing the number of collision calculations, or your cloth simulation does
not require the maximum level of collision accuracy (for example, for a
distance shot of colliding nCloth objects).
7
Reset the Collision Flag to the default Face selection, and select Off from the
Solver Display drop-down list.
5 | nCloth
> Beyond the lesson
Refine nCloth collisions by adjusting the Thickness and Collision Flag of the
nCloth and passive objects in a scene.
For more information and related techniques about nCloth, refer to the Maya
Help.
5 | nCloth
> Introduction
Lesson 2
Introduction
Often times, to create certain cloth effects, you need to attach nCloth to other
nCloths or passive collision objects and have those other Maya Nucleus objects
restrict or drive your nCloths movements. For example, you can use nCloth
constraints to create buttons on nCloth garments, replace collisions, bind
topologically different nCloth objects together, and exclude and limit nCloth and
passive object collisions.
In this lesson you learn how to:
5 | nCloth
> Lesson setup
Lesson setup
To ensure the lesson works as described, do these steps before beginning:
1
You can open the scene named Flag.mb from the Maya DVD or from the
drive where you copied the Getting Started with Maya Unlimited data files.
The file is located in UnlimitedLessonData/nCloth.
This scene includes dynamic meshes that have been created for you. The
pirate flag and the flag pole provided are an nCloth object and a passive
collision object respectively.
5 | nCloth
> Constraining an nCloth to a passive object
The flag falls downward through the air. For the flag to retain its position
beside the flag pole in XYZ space, it needs to be constrained to the static
flag pole passive object.
2
Right-click the flag and select Vertex from the context-sensitive menu that
appears.
Dolly in the camera so that you can view the vertices along the left side
border of the flag closely.
5 | nCloth
> Constraining an nCloth to a passive object
Points selected to
be constrained.
5 | nCloth
> Constraining an nCloth to a passive object
5 | nCloth
> Constraining an nCloth to a passive object
5 | nCloth
> Constraining an nCloth to a passive object
Point to Surface
constraint between
the flags CVs and
the flag pole.
5 | nCloth
> Changing which nCloth points are constrained
Dolly in the camera so that you can view closely the Point to Surface
constraint links that are visible between the flag and its flag pole.
5 | nCloth
> Changing which nCloth points are constrained
Selected Point to
Surface constraint links.
5 | nCloth
> Changing which nCloth points are constrained
The flag points and the flag pole surface that are members of the selected
Point to Surface constraint highlight in the scene view.
5 | nCloth
> Changing which nCloth points are constrained
Right-click the flag and select Vertex from the context-sensitive menu that
appears.
The flag switches to vertex display mode.
5 | nCloth
> Changing which nCloth points are constrained
Select all the flag points, except the top most and bottom most points.
5 | nCloth
> Changing which nCloth points are constrained
Selected Point to
Surface constraint
member points.
5 | nCloth
> Changing which nCloth points are constrained
The selected constrained flag points are removed from the constraint and
their constraint links disappear from the scene view.
5 | nCloth
> Changing which nCloth points are constrained
5 | nCloth
> Making nCloth flap in dynamic wind
5 | nCloth
> Making nCloth flap in dynamic wind
Lift specifies the amount of lift that is applied to the flag and Drag specifies
the amount of drag applied to the flag, causing resistance to the Maya
Nucleus solvers dynamic wind.
5 | nCloth
> Making nCloth flap in dynamic wind
nCloth flag
simulation with:
Lift = 1.0
Drag = 0.6
You can increase the speed at which the flag flaps, as well as the amount of
ripples moving across the flags surface, by increasing the Maya Nucleus
solvers Wind Speed.
5 | nCloth
> Beyond the lesson
nCloth flag
simulation with:
Lift = 1.0
Drag = 0.6
Wind Speed = 0.4
Constrain nCloth.
5 | nCloth
> Beyond the lesson
For more information and related techniques about nCloth, refer to the Maya
Help.