• home
  • forum
  • my
  • kt
  • download
  • Home / 3D Graphics / Maya / Effects /

    Falling leaves with nCloth and Paint Effects

    Author: 2007-06-23 13:21:07 From:








    2. MENU "Modify: Convert: Paint Effects to Polygons"





    3. Select the Leaves








    4. MENU "nCloth: Create nCloth"




    The leaves will now fall downward during playback. On the nucleus node turn on "Use Plane" to collide with the ground. The playback will be rather slow. To speed things up set the substeps and max collision iterations on the nucleus node to 1. Also turn off "Self Collide" on the nClothShape. (If you want to collide the leaves with each other you can enable this, but you will likely wish to make the selfCollideWidthScale 1.0 and lower the thickness a bit) The simulation should now playback quickly. Raise the friction on the nCloth and the planeFriction on the nucleus node so the leaves don't slide too much.







    5. Increase the nCloth bend resistance




    The preset in this tutorial has a little bend on the leaves so that they will curl as they fall, in typical leaf fashion. We need some bend stiffness for this to work. The Stretch/Compression/Bend resistance can all be set to 1.0 (if you have more segments on the leaves then you will need higher values)



    6. Increase Lift and Drag on the nCloth




    Setting both attributes to 0.3 works pretty well. In general if you make the lift higher than the drag it will be too energetic, but it provides a nice control over the character of motion. You can also make the tangential drag a little higher than zero so that there is some resistance to motion in the plane of the leaf. With tangentialDrag at 1 and lift at 0 we have simple uniform drag which looks boring and unnatural:


    sunsetLeafUniformDrag.avi


    If we lower the tangentialDrag to 0 but still have zero lift the effect is somewhat more interesting, but you still don't get the desired looping motion:


    sunsetLeafNoLift.avi


    When we add in the effect of lift the animation becomes much more natural:


    sunsetLeafFall.avi



    7. Have some fun!




    We can play with various cloth attributes during playback to see how it affects the simulation. Try editing the wind strength and direction on the nucleus node to blow the leaves around. You can pull all the leaves back onto the tree by raising "Input Mesh Attract". Note that if one animates the original pfx tree( with turbulence for example) then this attraction is to the animated leaf positions. One could have the tree blowing around using turbulence on the pfx brush node then animate the inputMeshAttract from 1 to zero to release the leaves. Raising deform Resistance will freeze the overall group of leaves as if they were in a block of ice. Lowering it will then "melt" the ice (not realistic, but still fun).





    The rest of this tutorial will cover how to attach the leaves to the tree and dynamically break the attachments(through wind or tree shaking) such that the leaves don't all fall at once.



    8. Select the leaves and the tree





    9. MENU: "nConstraint: Component to Component"




    By default each cv on the leaf object is connected to the nearest cv on the tree object, and visa versa. Instead we only want connections where the leaves touch the tree. To do this set the constraint "Connection Method" to "Within Max Distance"
    Now when you playback some leaves will fall, because all their cvs are further the the default "0.1" Max Distance from the tree cvs. We can simply increase the Max Distance to about 0.3. Playback will now be slower because this creates many connections( some redundant ones ). The longer connections can help keep the leaves from twisting about the branch. A more accurate connection would involve connecting edges to edges and using the bendStrength on the constraint to keep the leaves from twisting, although this is much slower to compute. To do this lower the constraint max distance to about 0.08 and on the two nComponent nodes set "Component Type" to edge.







    10. Set glue strength so bonds can break.




    Set the constraint glue strength to about 0.2 and increase the wind speed on the nucleus node to blow leaves off the tree. Note that one may wish to type values greater than 1.0 into the wind speed. Alternately you could have turbulence animation on the oakBigLeaf brush to shake the leaves off. One could also key the brush Uniform Force attribute to bend the tree. Note that if you are using an edge to edge constraint with bend strength then you also need to set the constraint "Bend Break Angle".







    In the following animation the brush Path Follow attribute was animated to bend the tree, following by an increase in Wind Speed on the nucleus node.






    sunsetLeafBlow.avi


    The following project contains the scenes sunsetLeafFall.ma and sunsetLeafBlow.ma as well as source image files.


    sunsetLeaf.zip

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      Animation (19)
      Modeling (34)
      Character Setup (12)
      Textures and Materials (17)
      Effects (4)
      Tips and Techniques (3)
      Getting Started (3)
      Using Tools and Scripts (0)
      Lighting (5)

    New

    Hot