You can use nConstraints with nHair to style, position, and hold hair curves. When creating constraints, be aware of the following behaviors:
See also Constraining Nucleus objects.
Create an nHair Transform constraint
You can create a Transform constraint to hold specific nHair curves CVs in place or move them through XYZ space.
To create an nHair Transform constraint
The nHair curve CVs you selected are now constrained to their current positions in X, Y, and Z space, and a Transform constraint locator is created for the selected nHair curve components.
The curves are also now connected to the nHair system's Nucleus solver through a dynamicConstraint node.
The preset properties on the dynamicConstraint node determine the constraint’s type (in this case, a Transform constraint) and how it behaves. For example, you can create a Transform constraint with the following attribute settings:
Creating an nHair Component to Component constraint
You can create a Component to Component constraint to attach hair system curves to other nHair curves or to other Nucleus objects components. For example, you can constrain selected hair curve CVs to the vertices of a passive collision hair clip or barrette so that it holds the hair in place.
The hair curve CVs you selected are now constrained to the selected target vertices, and they are now connected to the nHair system's Maya Nucleus solver through a dynamicConstraint node.
The preset properties on the dynamicConstraint node determine the constraint’s type (in this case, a Component to Component constraint) and how it behaves. For example, you can create a Component to Component constraint with the following attribute settings:
Creating an nHair Point to Surface constraint
You can create a Point to Surface constraint to attach hair curve CVs to a target surface such as a deforming nCloth surface, or a passive collision object. For example, you can use a Point to Surface constraint to hold an nCloth hat or head-band to a character's hair.
To create an nHair Point to Surface constraint
The target surface can be an nCloth or passive object, or a non-Nucleus polygon mesh.
The nHair curves components you selected are now constrained to the selected target surface, and they are now connected to the nHair system's Maya Nucleus solver through a dynamicConstraint node.
The preset properties on the dynamicConstraint node determine the constraint’s type (in this case, a Point to Surface constraint) and how it behaves. For example, you can create a Point to Surface constraint with the following attribute settings:
Creating an nHair Slide on Surface constraint
You can create a Slide on Surface constraint to attach hair curve CVs to a target surface, such as an nCloth or a passive collision object surface, and allow the constrained curve components to move or slip along the surface to which it is constrained. You can use a Slide on Surface constraint instead of collisions, and in most cases it works faster than collisions. For example, you can Slide on Surface constrain constrain hair curves to a Nucleus object so that the objects attract each other without colliding.
To create an nHair Slide on Surface constraint
The target surface can be an nCloth or passive object, or a non-Nucleus polygon mesh.
The nHair curves components you selected are now constrained to the selected target surface, and they are now connected to the nHair system's Maya Nucleus solver through a dynamicConstraint node.
The preset properties on the dynamicConstraint node determine the constraint’s type (in this case, a Slide on Surface constraint) and how it behaves. For example, you can create a Slide on Surface constraint with the following attribute settings:
Creating a Force Field constraint
You can create a Force Field constraint to push nHair curve CVs away from the center of the constraint, in a radial field with spherical volume bounds. For example, you can push out specific hair curves to create a general shape for a hair style.
To create a Force Field constraint
The Force Field locator appears near the selected hair curves, and the dynamicConstraint node appears in the Attribute Editor.
The location, size, and rotation of the locator determines the size, shape and volume of the force field constraint.