Show in Contents
Add to Favorites
Home: Autodesk Maya Online Help
nCloth Bag of Marbles
nCloth Examples
nCloth Balloon
nCloth Tree
This example will show you how to create a tree
with falling leaves using nCloth. The leaves will react to a number
of forces such as wind and gravity as well as display properties
such as bend.
Create a tree
You will begin by creating a tree using Maya’s Paint
Effects tool and then transforming the leaves into nCloth
objects.
To
create a tree using Paint Effects
- Select
the Paint Effects tab on the Maya
shelf.
- Select
the Simple Tree brush and paint
a single tree in your scene.
You can use the Scale Tool to
make the tree bigger, however the instructions in this example are
designed for the default size.
- Select
Modify > Convert > Paint Effects to Polygons.
- Change
to the Select Tool and select the
leaves.
- In
the nDynamics menu set, select
nMesh > Create nCloth.
Maya creates a solver called nucleus1 and adds
the leaves to it.
- In
the Attribute Editor, select the nucleus1 tab.
- In
the Ground Plane section, turn
on Use Plane.
- In
the Solver Attributes section,
set Max Collision Iterations:
1
- Select
the nClothShape1 tab, and in the Collisions section
adjust the attributes as follows:
- Self
Collide: Off
- Friction:
1
- Set
the End Time of the playback range to 50.
- Playback
the simulation.
The leaves fall straight down from the tree
to the ground.
This effect can be made more realistic with
the addition of leaf bends, lift and drag.
Setup the leaves
To
make the leaves curl
- Select
the leaves.
- In
the Attribute Editor select the nClothShape1 tab.
- In
the Dynamic Properties section
make the attributes as follows:
- Stretch
Resistance: 10
- Compression
Resistance: 10
- Bend
Resistance: 15
To
give the leaves more realistic physics
- In
the Attribute Editor, select the nClothShape1 tab.
- In
the Dynamic Properties section,
adjust the attributes as follows:
- Lift:
0.08
- Tangential
Drag: 0
- Playback
the simulation.
The leaves now bend as they fall and hit the
ground. They also do not fall straight down, instead they blow about
a bit on the ground. You can further adjust these settings to refine
the effect.
Constrain the leaves
Unlike your simulation, a tree in real life
seldom sheds all its leaves at once. To simulate a real tree you
must constrain the leaves to the branches until a force powerful
enough to remove them affects the tree.
To
constrain the leaves to the tree
- -select
the leaves and the tree.
- In
the nDynamics menu set, select
nConstraint > Component to Component.
- In
the Attribute Editor, select the
DynamicConstraintShape1 tab and in the Dynamic Constraint Attributes section
adjust the attributes as follows:
- Connection
Method: Within Max Distance
- Max
Distance: 0.1
- Glue
Strength: 0.04
NoteIf you scaled the tree you must alter these
values to achieve the desired effect. The larger the tree is scaled,
the higher these values must be.
- Playback
the simulation.
The leaves stay attached to the tree.
By adjusting the Glue Strength attribute
in step 4 you can modify the amount of force that must be applied
to knock the leaves from the tree. You can use a variety of methods
(such as wind or turbulence) to pull the leaves off. In this example
wind is used.
Blowing the leaves off the tree
To
blow the leaves off the tree using wind
- Select
the leaves.
- In
the Attribute Editor select the nucleus1.
- In
the Gravity and Wind section set Wind
Speed to 40.
- Playback
the simulation.
The leaves blow off the tree.
NoteIf you want to hide the constraint in the
scene view,
-click
the
dynamicConstraintShape1 node
in the
Hypergraph:Connections window and
select
Hide. This will make your tree
appear cleaner and improve the speed of your playback.