-
-
Save krclark/34d419c4b72e8f3c4e46cf8b0de2d175 to your computer and use it in GitHub Desktop.
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
#creates and parents a polySphere at every joint in a characters skeleton, beginning at the variable core | |
import maya.cmds as cmd | |
size = 5 | |
names="ball" | |
core = "AnimData_Hips" | |
cmd.polySphere(n=names) | |
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) | |
jointsAll.reverse() | |
for place in jointsAll: | |
print(place+"\n") | |
coords = cmd.xform(place,q=True,ws=True,rp=True) | |
cmd.polySphere(n=names+"_"+place) | |
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