Go to:
Return value. Related commands. Flags. Examples.
Synopsis
cpConstraint [flags] [objects ...]
This command creates a constraint on a cloth mesh. The use of
this command requires multiple selection. One selection is an
object which will act as the constraint. The other selection is either
a group of cloth vertices to be constrained, or a curve on the cloth panel.
There are currently 5 types of constraints:
1. Transform constraint, which constrains a set of cloth vertices to
follow another object's transform.
2. Mesh constraint, which constrains a set of cloth vertices to follow a set
of triangles of a rigid body.
3. Field constraint, which affects a
set of cloth vertices by a dynamics field.
4. Cloth constraint, which constrains
points on one cloth to the triangles of another cloth (or the same cloth).
Return value
Name of constraint. (string)
Related commands
cpButton, cpPanel, cpSolver, cpCollision, cpProperty, cpTool, cpSeamFlags
assigner, help, name, type
| Long name (short name) | [argument types] | Properties |
|---|
-help
(-h)
| |  |
|
Prints a quick help message.
|
|
-type
(-t)
| type name |  |
|
Specifies the type of constraint target. Currently, the
type name must be cloth, transform, mesh, or field. The default value is
transform. Type names: [cloth|field|mesh|transform|resimulation]
|
|
-assigner
(-a)
| assigner type |  |
|
Specifies the type of assigner: points or curve. A curve assigner allows
you to pick a construction curve that was used to make a cloth panel, and
a target object. The point assigner allows you to pick a set of points
on cloth and a target. Assigner types: [point|curve]. If you have 2
objects selected, then the default is curve. If you have 1 non-component object
selected, then the default is point.
|
|
-name
(-n)
| objectName |  |
|
Specifies the name of the constraint object transform. The actual shape name
will be objectNameShape.
|
|
Flag can appear in Create mode of command
|
Flag can appear in Edit mode of command
|
Flag can appear in Query mode of command
|
Flag can be used more than once in a command
|
Examples
// Select some vertices of the cloth mesh, the shift-select a transform
// of an object that has some keyframes.
//
cpConstraint;
// Create a cloth mesh. Select a curve used as a construction curve
// for a cloth panel. Shift-select a mesh object that has been
// converted to a cloth collision object.
//
polyTorus;
scale 20 20 20;
move 0 -20 0;
select -r pTorus1;
cpCreateRigidMesh;
select -r curve1;
select -add pTorus1;
cpConstraint -type mesh;
// Select nothing. Create a dynamics radial field. Select some vertices
// of the cloth mesh, the shift-select the radial field.
//
select -cl;
radial -m 5000; // High magnitude used for cloth
move 0 -20 0;
select -r cloth1.vtx[132:134];
select -add radialField1;
cpConstraint -type field;
// Query the type of assigner for the constraint.
//
cpConstraint -q assigner transformConstraint1;
// Query the type of constraint.
//
cpConstraint -q type sleeveConstraint;
// You cannot edit either the type or assigner flag. You must
// delete the constraint and create a new type.
//
//
cpConstraint -e -type cloth sleeveConstraint;
// Error: You cannot edit the constraint type