Go to: Synopsis. Return value. Flags. Python examples.
matchTransform(
[objects...]
, [pivots=boolean], [position=boolean], [rotation=boolean], [scale=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
matchTransform is undoable, NOT queryable, and NOT editable.
This command modifies the source object's transform to match the target object's transform.If no flags are specified then the command will match position, rotation and scaling.
None
| Long name (short name) | Argument types | Properties | ||
|---|---|---|---|---|
pivots(piv)
|
boolean
|
|
||
|
||||
position(pos)
|
boolean
|
|
||
|
||||
rotation(rot)
|
boolean
|
|
||
|
||||
scale(scl)
|
boolean
|
|
||
|
||||
import maya.cmds as cmds
# create a cone and randomly transform it
cmds.polyCone(n='cone1')
cmds.scale(0.2, 2.0, 0.2);
cmds.rotate(20, 45, 70)
cmds.move(-2, 0, 2)
# create a cylinder
cmds.polyCylinder(n='cylinder1')
# modify the cylinder's transform to match the cone
cmds.matchTransform('cylinder1','cone1')