Go to: Synopsis. Return value. Flags. Python examples.

Synopsis

transformCompare( [dagObject dagObject] , [root=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

transformCompare is undoable, NOT queryable, and NOT editable.

Compares two transforms passed as arguments. If they are the same, returns 0. If they are different, returns 1. If no transforms are specified in the command line, then the transforms from the active list are used.

Return value

int0 if successful, 1 if transform1 and transform2 are not determined to be equal.

Flags

root
Long name (short name) Argument types Properties
root(r) boolean create
Compare the root only, rather than the entire hierarchy below the roots.

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.

Python examples

import maya.cmds as cmds

# Create some joints
#
cmds.select( d=True )
cmds.joint( p=(-3.226531, 0, -4.866136) )
cmds.joint( p=(2.817897, 0, -4.016915) )
cmds.joint( 'joint1', e=True, zso=True, oj='xyz', sao='yup' )

# Compare 2 different joints, a 1 will be returned
#
cmds.select( 'joint1', 'joint2', r=True )
cmds.transformCompare()

# Duplicate joint1 and compare the duplicate
#
cmds.select( 'joint1', r=True )
cmds.duplicate()
cmds.select( cl=True )
cmds.select( 'joint1', 'joint3', r=True )
cmds.transformCompare()