Making Hair Move with Dynamics

 
 
 

By applying dynamics to hair, you can have it respond to the movement of the hair emitter object, as well as any natural forces or obstacles you set up for it. You can play back the dynamics live while you're tweaking to get just the right motion, or write the simulation to cache files and then read them for faster playback and consistent rendering, even when skipping frames.

Hair with dynamics applied and a wind force from behind.

When you apply dynamics to hair, you make it possible for the hair to move according to the velocity of the hair emitter object, like long hair whipping around as a character turns her head quickly. The dynamics calculations also take into account any natural forces applied to hair such as gravity or wind (see Forces), as well as any collisions of the hair with obstacles.

Note
  • You need to apply dynamics to hair before you can apply a natural force to it.

  • When the dynamics operator is active, you cannot do any styling on the hair. To get back into styling mode, see Muting the Dynamics Operator for Styling.

  • If you have animated the parameters of certain style operators (Clump, Comb, Puff, Rotate, or Scale) or have animated deformations on the hair, you cannot also use dynamics.

Applying Dynamics to Hair

To apply dynamics to hair

  1. Select the hair object.

    If you're applying dynamics to hair created from curves, make sure to select the "hair curves," not the source curves from which you generated the hair.

  2. Choose Create Dynamics on the Hair toolbar.

    When you choose this command, a hair dynamics operator is added to the hair object's stack (above the hair generator operator), and the Dynamics Operator property editor appears in which you can cache files for faster playback (see the next section).

    NoteFor information on the Sensitivity to Forces parameters in this property editor, see Setting Up Forces for Hair.
  3. On the timeline, select the Loop icon and click Play. By default, the dynamics are played back in live mode.

  4. Move the hair emitter object around or animate its transformations, apply a natural force to the hair, or have hair collide with obstacles.

    You can also adjust the Dynamics parameters to determine how the guide hairs react to the effect of dynamics. See Adjusting the Hair's Reaction to Dynamics for information.

Caching Files for Playback

You can cache dynamic simulation files for faster playback using the options in the Hair Dynamics Operator property editor. Caching the simulation to file (using either the Read&Write or Read Only options) means you can move to any frame and get an update, as well as play the simulation backward. It also provides for consistent rendering results and motion blur calculations.

By default, the Cache Mode is set to Live (no caching) so that you can work with the time looped and have the hair update constantly based on any changes you make to the hair parameters. This mode is best for testing out different options as you're working; however when you're ready to render and/or calculate motion blur, switch the Cache Mode to Read&Write or Read Only (the latter for the final render that you don't want to change).

To write to and read from cache files

  1. Select Read & Write as the Cache Mode. When you change a hair parameter, the simulation is reset and the cache is cleaned, but nothing is recomputed until you change frames.

  2. Enter a location and name for the cache file. By default, it writes to the Simulation folder of the current project. If you select Usr, the path is displayed as you entered it; if you select Res, the resolved path is displayed.

  3. Play the simulation to cache the files.

  4. Click Clear Cache to delete the current cache files in the folder; that is, it won't clear cache files with names different from what is currently set for the Filename. The dynamics are not reset when you delete the cache.

  5. Click Reset Dynamics to reset the hair to its state at the time that dynamics was applied to the style.

    Tip
    • To increase the speed of the playback, mute any viewport that you're not using by middle-clicking its letter (A, B, C, or D).

    • Make sure to name the cache file with a different name for each iteration of the simulation you want to keep; otherwise, the cache will be overwritten each time you save the file.

    • If you keep the cache files, make sure to check the storage folder you have defined for them and delete any unused files. These can build up and take up lots of space if you don't occasionally do some housecleaning!

    • The cache file is not automatically copied with the scene if you save it in a new project. Make sure to copy the cache files to the Simulation folder (or wherever you want them) in the new project so that you don't lose valuable data!

To read the dynamics from cache files

When you're ready to render the final simulation, select Read only as the Cache Mode. The dynamics data is read from the current cache file, but does not write new cache files, even when you make a change to the hair. This prevents any changes from being made.

To get ready for the final render, follow these steps:

  1. Go to the beginning of the simulation that you want to cache.

  2. Select Read only as the Cache Mode.

  3. Enter a location and name for the cache file. By default, it writes to the Simulation folder of the current project. If you select Usr, the path is displayed as you entered it; if you select Res, the resolved path is displayed.

  4. Click Clear Cache to delete the current cache files in the folder.

  5. Click Reset Dynamics to reset the hair to its state at the time that dynamics was applied to the style.

  6. Go to the end frame to calculate the entire cache to file.

Adjusting the Hair's Reaction to Dynamics

Once you have dynamics applied to the hair, you can set the parameters on the Dynamics page in the Hair property editor to determine how the hair reacts to the dynamics. These parameters are applied to the guide hairs.

The Dynamics parameters (except Wiggle) can have weight and texture maps connected to them, as identified by a little connection icon beside them. This allows you to create either specific patterns or random values for the hair, depending on the effect you want. For example, you can use a weight map on the Stiffness parameter so that the hair is stiffer in specific areas, such as where the hair is shorter.

Because these parameters only affect guide hairs, subtle value variations in the maps be lost, so you may find weight maps to be generally more effective than texture maps.

Stiffness

Stiffness is the tendency of the hair to hold its rest shape and resist the dynamics that are affecting it, rather like a good hair spray! This is the stiffness of the guide hair starting from the tip and going down to the root. A value of 1 means that hair will always keep its styled shape and resist the effect of dynamics on it, while a value of 0 means no resistance to dynamics.

Root Stiffness is the same as Stiffness except that it determines the stiffness at the root of each guide hair. The values are the same as for Stiffness, with the default value of 1 meaning that the root always keeps itself aligned in the direction of the style.

You can use Stiffness and Root Stiffness together to have varying levels of stiffness along the length of the guide hair. For example, with a low Stiffness value and high Root Stiffness value, you can have the hair affected by dynamics only toward the tips.

   

Sphere moving through grass that has a Stiffness value of 0.1, showing little resistance to the dynamics.

Sphere moving through grass that has a Stiffness value of 0.5. Notice that the grass is quite a bit stiffer, resisting the dynamics more and keeping its shape.

Dampening

Dampening determines how quickly the hair recovers from the effect of dynamics. With a value is 0, the hair does not return to its position; with higher values (maximum value is 1), the hair bounces back into its styled position more quickly.

Wiggle (Random Displacement)

Wiggle simulates the effect of a light breeze, moving randomly about the points of the guide hairs. Its Amplitude controls the strength or amount of the point displacement, and its Speed controls how quickly or slowly the displacement occurs, like wheat stubble on a field quickly quivering in the wind or seaweed slowly swaying with the waves.

TipYou can also animate the Frizz settings (also on the Effects page), which can give similar results as the Wiggle parameters except that it affects only the render hairs. Generally, this is more desirable because you don't see any interpolation between the guide hairs. See Frizzing Out for more information.

Muting the Dynamics Operator for Styling

Once you've applied dynamics on the hair object, you cannot do any hair styling using the style operators on the Hair toolbar unless you mute the dynamics operator. This is because dynamics need to be calculated on a specific styling "state" that cannot change during playback.

If you style the hair with dynamics active, nothing will happen because no styling operator is added to the stack (and you'll see an error logged in the script editor).

To mute the dynamics operator

  1. Do one of the following:

    • Click the Style button at the bottom of the Hair toolbar.

      or

    • Select the Mute option in the Hair Dynamics Operator property editor.

      or

    • Right-click on the Hair Dynamics Operator in the explorer and choose Mute.

  2. Style the hair into a new state.

  3. Unmute the dynamics operator.

    Now when you play back the simulation, the dynamics operator uses this new "rest state" to update the dynamics.

    Note
    • If you freeze the hair operating stack (see Progressive Styling by Freezing the Stack) with the dynamics operator is muted, the dynamics operator is not removed.

    • When you reapply styling after dynamics, the hairs may have shifted a little. To get back to the "real" current hair state, click the Style button, click Reset Dynamics in the Dynamics Operator property editor, or move the hair emitter object.