def create_joint_chain(positions, **kwargs):
'''Create a joint chain from a list of om.MVectors'''
aim_vects = [b - a for a, b in zip(positions, positions[1:])]
aim_vects.append(aim_vects[-1])
joints = [create_joint(pos, aim, **kwargs) for pos, aim, in zip(positions, aim_vects)]
for parent, child in zip(joints, joints[1:]):
cmds.parent(child, parent)
cmds.setAttr(joints[-1] + '.jointOrient', 0, 0, 0) # Zero out the last joint in the chain
return joints
评论列表
文章目录