Hi guys,
I have a really tough question here. I’m trying to write some python code for animating a human hand touching and carrying other objects. I know that you can do this by putting the armature into Poser mode, then attaching a “follow path” constraint to the child bone, then attaching an IKA solver to the same child bone, but I just have no idea how to do this in python. I tried looking at Posebone’s documentation and there is an attribute called “constraints” but there is no documentation on how to use/modify this attribute.
Could someone please let me know if it is even possible to do what I want in python?
Thanks so much for reading.
Edit: I just accessed the “constraint” attribute of the bone that I was interested in, here is the code:
pose = armObj.getPose()
pose_bones = pose.bones
endBone = pose.bones['b2']
for x in endBone.constraints:
print x
Here is the output:
[Constraint "Const", Type "Follow Path"]
[Constraint "Const.001", Type "IK Solver"]
This looks really promising, but I still have no idea how to add these two constraints in python. Furthermore, if I could add these two constraints in python, should I just modify the “loc” attribute of the relevant bone to create the different poses of touching a target?
-D