Skip to content

Instantly share code, notes, and snippets.

@manhha00
Created January 8, 2018 17:34
Show Gist options
  • Save manhha00/4529e94718a42f078a99d1570ea43c45 to your computer and use it in GitHub Desktop.
Save manhha00/4529e94718a42f078a99d1570ea43c45 to your computer and use it in GitHub Desktop.
maya - python - move - rotate - xform
import maya.cmds as cmds
pos = cmds.xform('chest_JNT_JNT', q=1 , ws =1 , t=1)
print pos
cmds.xform('chest2', ws =1, t =pos)
cmds.move( pos[0] , pos[1] , pos[2] , 'chest2', rpr=1)
rot = cmds.xform('chest_JNT_JNT', q=1 , ws =1 , ro=1)
cmds.xform('chest2', ws=1, ro= (rot[0] , rot[1] , rot[2]))
cmds.rotate(0, -180, 0 ,'chest2', os = 1, r=1 )
cmds.select('chest2')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment