Animation control

Coded during lecture so probably a few kinks left to work out :) Creates a zeroed out animationcontroller. Select desired joint followed by control shape.

# Align a selected controler to a joint and 
# zero out the control

import maya.cmds as mc

sel =

#align control object to joint
objParent = sel[0]
objChild = sel[1]
objConstraint = mc.parentConstraint(objParent, objChild)

#select control
sel =

#duplicate selected control
mc.duplicate(sel[1],n=sel[0] + "_NUL")

#remove shapenode
emptyNode = mc.delete(,s=1, dag=1))

#add original controller under newly created node
mc.parent(objChild, emptyNode) 

#rename control curve
mc.rename(objParent+"_CTRL", ignoreShape=1)
I wish to do something Great and Wonderful, but I must start by doing the little things like they were Great and Wonderful”
~ Albert Einstein