Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def snap (rotation = True, translation = True):
- import maya.cmds as cmds
- selection = cmds.ls(sl = True)
- if selection:
- if len(selection) > 1:
- master = selection[0]
- slaves = selection[1:]
- trans = cmds.xform(master, t = True, ws = True, query = True)
- rot = cmds.xform(master, ro = True, ws = True, query = True)
- for slave in slaves:
- if translation:
- cmds.xform(slave, t = trans, ws = True)
- if rotation:
- cmds.xform(slave, ro = rot, ws = True)
- snap(translation = False, rotation = True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement