Combination with Hair Particles
Particle systems of type Hair may be animated as a softbody.
- Create a working Hair particle system. It is not necessary to make it editable.
- Change to the Physics sub-context.
- Select the particle system instead of the object in the Soft Body panel (Image 1a).
- Turn on Soft Body.
The default settings are not optimal for hair, so lets change them.
Each hair has a number of keypoints (number of segments plus one) which perform the role of the vertices in Softbody calculation. It works in a similar way to animating curves with varying Control Point Weights, where the root gets a weight of 1.0, and the tip a weight of 0.0.
The Control Point Weight serves as the Goal for the Softbody simulation, so you can control how much each section of the hair moves. To edit the hair you need to set it Editable, then you can switch to Particle mode and perform weight painting on the control points.
To optimize the simulation you should:
- Keep the number of hairs as low as possible.
- Keep the number of segments as low as possible.
- Avoid collisions as much as possible, e.g. work with a simplified object that calculates collisions.
Goal, Goal, Goal!
Each keypoint of a hair particle tries to maintain it’s position based on it’s weight setting, i.e. the hair tries to stay in shape. Imagine that there is a little spring which connects the keypoint with it’s original position. The goal stiffness (G Stiff) is the stiffness of this spring. The Goal value defines how much the keypoint responds to external forces (that have been configured to interact with the softbody animation).
- If the goal value of a keypoint is 1, the keypoint won’t be affected by softbody animation (but of course is will still move if you apply normal animation to the object).
- If the goal value of a keypoint is 0, the keypoint is fully affected by softbody animation.
By default the root keypoints of hair particles have a goal of 1, so they will follow the emitter of the particles. The tip keypoints of hair particles have a goal of 0, so they are fully affected by the softbody animation. In between the root and tip weights are linearly interpolated.
- The root keypoint of a hair particle will always have a weight of 1, no matter what you do.
- You may paint the weight of each of the other keypoints individually in Particle mode (Image 2). A Strength of 50 is a weight of 0.5. So you can define parts of the hair that don’t move at all, e.g. behind the ears or held by a ribbon.
- The goal weight of each keypoint - except the root keypoint - is scaled by the G Min and G Max values (Physics sub-context, Soft Body panel). This is much quicker than trying to adjust the weights individually.
The force that keeps the keypoints together is calculated using the edge settings in softbody animation.
Turning jello into hair
We are not doing an exact physical simulation, instead we are faking the look and behaviour of hair, but there are so many different hair types. So I will try and list some common properties (this is not exactly scientific).
- Hair reacts to wind (if you only need wind you don’t necessarily need a softbody simulation, hair particles can react directly to force fields, like all other particles).
- It follows the movement of the body.
- It bends smoothly.
- It doesn’t change in length.
- It comes to rest quickly (doesn’t jitter).
- Hair needs some Friction (e.g. 0.01).
- The mass should be lowered (e.g. to 0.01) unless you like that heavy silky hair advertisement look.
- A little bending stiffness (Be to 0.1) helps the hair fall nicely.
- Edge Pull should be quite high (as large as, or higher than 0.9).
- It needs some serious damping (G Damp), e.g. 0.5 or higher.
If the mass of the keypoints is higher, you need more friction to stop the hair from wobbling.
G Min and G Stiff govern the appearance of the hair, often it is sufficient to change the stiffness. But that depends on the length of the hair. You will find that long hair needs more than 5 keypoints.
Collisions and Deflection
Let me give you the bad news first: no matter what you do, there is no way to achieve accurate deflection of hair when it collides with a fast moving object. If your object is accelerating quickly at least some parts of the hair will dive into it. The second problem is: collisions are slow to calculate. The third problem: collision is only calculated for the control points. So if you only have a few control points, there is very little data to base the collision on.
So avoid collision simulations as much as possible. Having said that, lets see what is possible with the interesting combination of hair and softbody.
- To let a softbody collide with another object, simply turn on Collision in the Collision panel of the Physics sub-context of the object.
- It often helps to increase the parameter Outer (the outer face thickness) of the collision object.
- When the keypoints of hair penetrate a collision object they are repelled. For hair this repulsion needs to be damped. If the repulsion is too strong increase Choke for the softbody system in the Solver panel.
As you can see, you can get a nice effect when hair falls slowly onto a collision object, though the deflection is not perfect (Image 4). If you do it the other way round and move the collision object slowly and at the correct angle, the collision also works. If the collision object is moved too fast and/or at the wrong angle it simply moves through the hair.