Skip to content

Instantly share code, notes, and snippets.

@KelSolaar
Created June 3, 2012 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KelSolaar/2862881 to your computer and use it in GitHub Desktop.
Save KelSolaar/2862881 to your computer and use it in GitHub Desktop.
Maya - Snap Pivots To Vertex
import maya.cmds as cmds
for transform in cmds.ls(sl=True, l=True):
point = cmds.xform("{0}.vtx[0]".format(transform), q=True, t=True, ws=True)
for pivotType in ("scalePivot", "rotatePivot"):
cmds.move(point[0], point[1], point[2], "{0}.{1}".format(transform, pivotType))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment