Go to: Synopsis. Flags. Return value. Related. MEL examples.
cpButton [-help] [-rotate double double double] [-translate double double double]
[obj ...]
cpButton is undoable, queryable, and editable.
This command creates one or more buttons on a cloth mesh. The use of this
command requires multiple selection or muliple objects on the command
line. The first objects to be selected are transforms that relate to
geometry to be attached to the cloth. Note: this command only takes into
account the transform of the object selected. It ignores whatever shapes
are children of the transform. The last object selected or listed must be
a cloth mesh.
After successful command completion, the transforms are reparented to a
new object of type cpButton. This cpButton object is also parented to
the cloth mesh's transform. You are free to move the button relative
to the cloth by simply changing the translation or rotation in the
channel box.
In summary, the cpButton command creates a locator called the cpButton
which tracks cloth mesh as it moves. The locator locks onto the
surface and maintains a relative orientation flush to the cloth triangle
that it is attached to.
help, rotate, translate
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
|
Name of button. (string)
cpCollision, cpConstraint, cpPanel, cpProperty, cpSeam, cpSolver, cpTool
// Create a cloth garment. Create 3 objects to represent 3 buttons.
// You can use cylinders or cones for example. Select the 3 button
// objects. Shift select the cloth mesh. This command preserves
// the position of the 3 objects.
//
cpButton;
// Same example, but now snap the buttons to the surface, but
// preserve the current rotation.
//
cpButton -t 0 0 0;
// Same example, but now snap the buttons to the surface, and
// align the rotation of the button's object y axis with the cloth
// normal.
//
cpButton -t 0 0 0 -r 90 0 0;
// Same example, but now snap the buttons to the surface, and
// align the rotation of the button's object z axis with the cloth
// normal.
//
cpButton -t 0 0 0 -r 0 0 0;
// Query the button offset.
//
cpButton -q -t button1;