Skip to content

Instantly share code, notes, and snippets.

Created November 13, 2016 19:44
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
#creates and parents a polySphere at every joint in a characters skeleton, beginning at the variable core
import maya.cmds as cmd
size = 5
core = "AnimData_Hips"
xhips = cmd.getAttr(core+".translateX", asString=False)
yhips = cmd.getAttr(core+".translateY", asString=False)
zhips = cmd.getAttr(core+".translateZ", asString=False)
cmd.move(xhips, yhips, zhips)
cmd.scale(size, size, size)
cmds.parentConstraint(core, names)
jointsAll = cmd.listRelatives(core, allDescendents=True)
for place in jointsAll:
coords = cmd.xform(place,q=True,ws=True,rp=True)
cmd.scale(size, size, size)
xhips = coords[0]
yhips = coords[1]
zhips = coords[2]
cmd.move(xhips, yhips, zhips)
cmd.parentConstraint(place, names+"_"+place)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment