Skip to content

Instantly share code, notes, and snippets.

Created November 13, 2016 19:52
  • 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 planes at each joint under the variable "core" and constrains them to the joint
import maya.cmds as cmd
size = 30
length = 100
offset = 10;
core = "AnimData_Hips"
xhips = cmd.getAttr(core+".translateX", asString=False)
yhips = cmd.getAttr(core+".translateY", asString=False) + offset
zhips = cmd.getAttr(core".translateZ", asString=False)
cmd.move(xhips, yhips, zhips)
cmd.scale(size, length, length)
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, length, length)
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