Hello people,
I'm currently going back to scripting in order to earn time on my rigs.
So I tried to make a quick Python rig to place my controlers on selected joints and add a parentConstraint.
Unfortunatly all the constraints appear, are well named, but only the last one is functional.
Any ideas ?
targetJoints = cmds.ls( sl=1 , typ='joint' )
for targetJoint in targetJoints :
ctrl_name = 'ctrl_' + targetJoint
ctrl_name = cmds.circle( c=(0, offsetY, 0) , nr=nr , sw=360 , r=radius , ch=False , n= ctrl_name);
grp_name = 'grp_' + targetJoint
radius = cmds.getAttr( targetJoint + '.radius' ) * 5
offsetY = 0
childJoints = cmds.listRelatives( targetJoint , c=1 , typ='joint' )
parent shape
cmds.group ( n=grp_name, r=True)
cmds.parent ( grp_name , targetJoint , r=True )
cmds.parent ( grp_name , w=True , r=False )
constraint
cmds.parentConstraint ( ctrl_name , targetJoint, mo=1)