Last active
August 20, 2016 15:56
-
-
Save EricTRocks/ac421c2b66e23938343fb75b675a3fb4 to your computer and use it in GitHub Desktop.
Maya Match Transforms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
import pymel.core as pm | |
def matchXfos(): | |
# get selection | |
sel = pm.ls(selection=True) | |
if len(sel) < 2: | |
pm.error( 'Please select two objects' ) | |
else: | |
srcObj = sel[0] | |
targets = sel[1:] | |
srcXfo = pm.xform(srcObj, query=True, worldSpace=True, matrix=True) | |
for tgt in targets: | |
pm.xform(tgt, worldSpace=True, matrix=srcXfo) | |
matchXfos() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment