Go to: Synopsis. Return value. Flags. Python examples.
matchTransform(
[objects...]
, [pivots=boolean], [position=boolean], [positionX=boolean], [positionY=boolean], [positionZ=boolean], [rotatePivot=boolean], [rotation=boolean], [rotationX=boolean], [rotationY=boolean], [rotationZ=boolean], [scale=boolean], [scaleBox=boolean], [scalePivot=boolean], [scaleX=boolean], [scaleY=boolean], [scaleZ=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
pivots, position, positionX, positionY, positionZ, rotatePivot, rotation, rotationX, rotationY, rotationZ, scale, scaleBox, scalePivot, scaleX, scaleY, scaleZ
Long name (short name) |
Argument types |
Properties |
|
pivots(piv)
|
boolean
|
|
|
Match the source object(s) scale/rotate pivot positions to the target transform's pivot.
|
|
position(pos)
|
boolean
|
|
|
Match the source object(s) position to the target object.
|
|
positionX(px)
|
boolean
|
|
|
Match the source object(s) X position to the target object.
|
|
positionY(py)
|
boolean
|
|
|
Match the source object(s) Y position to the target object.
|
|
positionZ(pz)
|
boolean
|
|
|
Match the source object(s) Z position to the target object.
|
|
rotatePivot(rp)
|
boolean
|
|
|
Match the source object(s) rotate pivot position to the target transform's pivot.
|
|
rotation(rot)
|
boolean
|
|
|
Match the source object(s) rotation to the target object.
|
|
rotationX(rx)
|
boolean
|
|
|
Match the source object(s) X rotation to the target object.
|
|
rotationY(ry)
|
boolean
|
|
|
Match the source object(s) Y rotation to the target object.
|
|
rotationZ(rz)
|
boolean
|
|
|
Match the source object(s) Z rotation to the target object.
|
|
scale(scl)
|
boolean
|
|
|
Match the source object(s) scale to the target transform.
|
|
scaleBox(box)
|
boolean
|
|
|
Use the source/target object's child bounding box size when matching scaling.
|
|
scalePivot(sp)
|
boolean
|
|
|
Match the source object(s) scale pivot position to the target transform's pivot.
|
|
scaleX(sx)
|
boolean
|
|
|
Match the source object(s) X scale to the target object.
|
|
scaleY(sy)
|
boolean
|
|
|
Match the source object(s) Y scale to the target object.
|
|
scaleZ(sz)
|
boolean
|
|
|
Match the source object(s) Z scale to the target object.
|
|
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 have multiple arguments, passed either as a tuple or a list.
|
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')