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

  1. Select the Paint Effects tab on the Maya shelf.
  2. 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.

  3. Select Modify > Convert > Paint Effects to Polygons.
  4. Change to the Select Tool and select the leaves.
  5. In the nDynamics menu set, select nMesh > Create nCloth.

    Maya creates a solver called nucleus1 and adds the leaves to it.

  6. In the Attribute Editor, select the nucleus1 tab.
  7. In the Ground Plane section, turn on Use Plane.
  8. In the Solver Attributes section, set Max Collision Iterations: 1
  9. Select the nClothShape1 tab, and in the Collisions section adjust the attributes as follows:
    • Self Collide: Off
    • Friction: 1
  10. Set the End Time of the playback range to 50.
  11. 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

  1. Select the leaves.
  2. In the Attribute Editor select the nClothShape1 tab.
  3. 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

  1. In the Attribute Editor, select the nClothShape1 tab.
  2. In the Dynamic Properties section, adjust the attributes as follows:
    • Lift: 0.08
    • Tangential Drag: 0
  3. 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

  1. -select the leaves and the tree.
  2. In the nDynamics menu set, select nConstraint > Component to Component.
  3. 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
      Note

      If 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.

  4. 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

  1. Select the leaves.
  2. In the Attribute Editor select the nucleus1.
  3. In the Gravity and Wind section set Wind Speed to 40.
  4. Playback the simulation.

    The leaves blow off the tree.

    Note

    If 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.