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 ?
Hi, I made a couple of modifications to your script and it worked (or so I think) according to what you are looking for. Be careful with the '; ', and also do not have if they have the index of the [for] and the [list] called equal.
Thank you for your reply Tomas, I finally found out what was the problem yesterday and it is due to a stupid oversight : my controllers needed to be parented between eachother so their transform could affect the rest of the hierarchy.. So now I'm trying to find out how to do it in python.
About your comment "nr" is the normal of the plane in which the circle will lie, I have different versions depending of the shape I'm using.
Anyway thank you for your modifications. Could you tell me why it would be more interesting to use this format
for target in range(len(targetJoints)) :
Instead of this one ?
for targetJoint in targetJoints :
As it seems to force to use a lot more characters during the script (targetJoints[target] instead of targetJoint)
Hi Jimmy, sure.. I consider myself a beginner in python, but I can always help
You can get the same result. ex:
targetJoints = ['joint1', 'joint2', 'joint3', 'joint4'] for targetJoint in targetJoints : print targetJoint result: joint1 joint2 joint3 joint4
but with the other for instead for target in range(len(targetJoints)) : print targetJoint[print targetJoint] result: joint1 joint2 joint3 joint4 if u print the 'target' u obtain the index number of targetJoints: for target in range(len(targetJoints)) : print target result: 0 1 2 3
The good thing is u can use the same 'for' for parent your controls or connect them. You can create math conditions to make parent between ctrl_name and grp_name orjust another list.