You can create a Slide on Surface constraint to attach nCloth components (vertices, edges, or faces) to a target surface (another nCloth surface, or a passive collision object), and allow the constrained nCloth 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 all the vertices in an nCloth shirt to a character model instead of making the character a passive object.
Note:
- If you use a Slide on Surface constraint in the place of collisions for an nCloth object, then turn off Collide in the nCloth’s nClothShape Attribute Editor tab. Otherwise, both collisions and the constraint will be calculated.
- If you use a Slide on Surface constraint in the place of collisions for an nCloth object, then you can not effectively use Collision Layers to control which members of your Maya Nucleus system can collide with the constrained nCloth object.
To create an nCloth Slide on Surface constraint
- In the scene view, select the nCloth components (vertices, edges, or faces) you want to constrain. If you select edges or faces, then all their vertices will be constrained.
- -select the target surface to which you want to constrain the nCloth components. The target surface can be a different nCloth object that is part of the same system, one of the nCloth’s passive objects, or a non-nCloth object.
Note:
If you selected a target surface that is a non-nCloth object, the surface will be made a passive object when the constraint is created.
- In the FX menu set, select > .
- (Optional) In the Create Slide on Surface Constraint Options Box window, turn on Use Sets to add the nCloth components and the target surface you selected to a dynamic constraint selection set.
- Click Create Constraint or Apply.
The nCloth components you selected are now constrained to the target surface you selected, and they are now connected to the nCloth’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:
- Spring as the Constraint Method
- Object to Object as the Constraint Relation
- All to First as the Component Relation
- Component Order as the Connection Method
- Per Frame as the Connection Update
- Turn on Local Collide properties.
See dynamicConstraintShape.