Applying A Hair Simulation To A Palm Branch




Using a hair system is a good way to dynamically simulate the swaying motion of a palm branch. The setup is fairly easy and with a little finessing, can yield great results. It really don't matter if the branch was modeled with NURBS or polygons. However, if the branch was modeled with NURBS, the process will be greatly shortened because NURBS provide the ability to reference and copy surface curves. To start, it's also a good idea to go ahead and pre-bend the branch. I did this by quickly using both a twist and bend deformer.

Here is a quick playblast of the end result:












Setting Up The Workspace



The first thing I did was to set up my shelf. I used NURBS to create my original branch so I created a shelf to support that workflow.





From left to right:
Edit Curves > Duplicate Surface Curves
Hair > Make Selected Curves Dynamic
Skeleton > Joint Tool
Skeleton > IK Spline Handle Tool (make sure "Auto Create Curve" is turned off in the tool's options)
Skin > Bind Skin > Smooth Bind





It is also a good idea to go ahead and set up your layers. There is a lot of information being passed around, and it's pretty important to keep it organized. Here is an example:




Lastly, under Preferences>Timeline, it is necessary to make sure that "Play Every Frame" is selected under Playback Speed.





Animating The Stem



Step 1 - Create the base curve

A) Right click on the stem and drag up to go into Isoparm selection mode. Select an isoparm running the length of the stem.
B) Edit Curves > Duplicate Surface Curves
C)This creates your base curve
D)To be safe, I Freeze transformations, Center Pivot, and Delete History on base curve.
E)Add this base curve to the Base Curves layer.




Step 2 - Make the Hair curve
A) Select the base curve
B) Hair > Make Selected Curves Dynamic

This is the actual dynamic curve. The base curve is required only to provide the position of the hair curve. This creates two new nodes: a follicle node and a hair system node.




Step 3 - Adjust the Hair curve
A) Select the new hair curve and open the attribute editor.
B) Under the hair follicle node, change Point Lock from "Both ends" to "Base"
C) Under the Hair System node, start playing with the settings. The settings are different for every plant. Here is an example of my settings:






Step 3 - Adding Joints

A) Make sure you are on frame 1.
B) Skeleton > Joint Tool
C) Use curve snapping (hold “C”) to place joints on the dynamic hair curve. Place more joints on points on the curve where there will be more bending.





Step 4 - Binding The Joints To The Hair Curve
A) Skeleton>IK Spline Handle Tool
B) Turn off Auto Create Curve
C) Select First Joint in the bone chain
D) Select Last Joint in the bone chain
E) Select the dynamic hair curve. If done right, a line will now connect the first and last joint.
F) Play the animation. The bones should now follow the dynamic hair curve. If it does not, make sure that you did not accidently bind the joints to the base curve.







Step 5 - Binding the Joints to the Geometry
A) Select the joints.
B) Select the stem.
C) Skin > Bind Skin > Smooth Bind
D) Play the animation. The stem geometry should now follow the hair curve.









Animating the Leaves






I’ve seen many different ways to approach adding hair-dynamics to the leaves. First, I’ve seen people use a single hair curve to drive multiple leaves. This works great but has a tendency to look a little fake since there will be a clump of leaves all moving in the exact same fashion. Another problem is that if the hair curve controls multiple leaves that spread over multiple joints on the stem, the stem may bend without the leaves following it. They will seem to pop off and float in mid air. The second method I’ve seen is to have one hair curve per leaf. This tends to look the best because all the leaves will be reacting dynamically independent of other leaves. However, depending on the plant, this can take a very long time. You would have to create a curve, make dynamic, add joint and IKs, and skin every leaf as well adjust each leaf’s hair system and follicle attributes. A third way to approach this would be to add one hair per leaf. However, instead of adding one hair system per leaf, it is possible to add multiple hairs to a single system. This way you only have to change one node’s dynamic attributes and still affect multiple hairs. This is the method I chose to use:



Step 1 – Generating the base curves:
If you model your leaves in NURBS, this can be quick and easy:
1) Select a group of leaves
2) Hover over one of the leaves and Right-click>Isoparm… shift click an isoparm running along the length of the leaf. The isoparm does not necessarily have to be in the middle of the leaf.
3) Do this for each leaf… be careful not to deselect any of your previously selected isoparms.
4) Edit Curves > Duplicate Surface Curves
This creates a base curve for each of the leaves you selected.
5) For precaution’s sake, I always select all my base curves, Modify>Freeze transformations, Modify>Center Pivot, and Edit>Delete By Type>Delete History. I noticed that, by doing this, it gets rid of some of the problems I had down the road.
6) For organization, place these base curves in your “baseCurves_layer” layer.







Step 2 – Parent the base curves to the stem:
1) Parent each base curve to the nearest bone by selecting the leaf, shift-selecting the bone and pressing P. This assures that each leaf will move correctly with the stem.




Step 3 – Add hair-dynamics to your curves:
It is possible to select all the base curves and add hair dynamics to all of them at once. However, I used the turbulence settings to add “wind” to the branch. I wanted the turbulence for some leaves to be slightly different than other leaves. To do this:
1) Randomly select a small group of leaves. Try not to select a group right next to each other.
2) Hair > Make Selected Curves Dynamic
3) These curves are now all grouped under the same hairSystem node. Any changes to this node (stiffness, gravity, start curve attract, etc.) affect all these curves at once. However, you’ll notice that each curve does not share a follicle node. In order to change the pivot for each leaf, you’ll have to change your Point Lock to “base” for each curve individually.
4) Do this for another group of leaves. Again, don’t select too many leaves right next to each other. This will ruin the “randomness” when you add different turbulence values to each hair. When I was finished, I had around 10 groups of leaves (10 hair systems for around 100 leaves).
5) Again, for organization, add these hair curves to their own layer.





Step 4 - Add Joints:
1) Skeleton>Joint Tool
2) Use curve snapping (hold “C”) to place joints on the dynamic hair curve (not the base curve).
3) Do this for each leaf. Each time you complete a leaf, press G to begin another chain.




Step 4 – Add IKs to your joints:
1) Skeleton>IK Spline Handle Tool>options
2) Turn off Auto Create Curve
3) Select First Joint in the bone chain
4) Select Last Joint in the bone chain
5) Select the dynamic hair curve. The bones will now follow the dynamic hair curve
6) Do this for every leaf.





Step 5 – Bind the leaves to the joints.
1) Select the joints.
2) Select the corresponding leaf.
3) Skin>Bind Skin> Smooth Bind




Step 6 – Adjust settings in each hair system.
Here is an example:





Step 7 - Add Turbulance
Under the hairSystem node, click the arrow beside Turbulence. Here, you can adjust the intensity, frequency, and speed. For the plant, it's best to stick to fairly low numbers (ex. Intensity .01, Frequency .2, Speed .5). Add slightly different numbers for each hair system. The plan will begin to seem as it is blowing in the wind.