Go to: Synopsis. Flags. Return value. Related. MEL examples.

Synopsis

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.

Flags

help, rotate, translate
Long name (short name) [argument types] Properties
-help(-h) create
Prints a quick help message.
-translate(-t) double double double createqueryedit
Specifies the relative offset for the button. If this flag is omitted, the default is for the button's world space translation to be preserved after the command has execute. In other words, the default value for -t is to preserve the button translation.

In query mode, this flag needs a value.

-rotate(-r) double double double createqueryedit
Specifies the relative rotation for the button. If this flag is omitted, the default is for the button's world space rotation to be preserved after the command has execute. In other words, the default value for -r is to preserve the button's rotation.

In query mode, this flag needs a value.


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

Return value


Name of button. (string)

Related

cpCollision, cpConstraint, cpPanel, cpProperty, cpSeam, cpSolver, cpTool

MEL examples

// 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;