[rigging script problem]cmds.connectAttr() casue wrong direction

Hi, I am trying to write a auto rigging script, but there is a problem quite disturbed me.

When i use node editor manually connect a customed attribtue to the rotateZ attribute of three controls. It works fine. The direction of those control is right.

But when i use script cmds.connectAttr(‘wrist_ctr.fist’,‘thumb_x_ctr.rotateZ’) to do this, those control get wired direction.
image

I’ve tried some many methods but still not resolve it. It would very very thanksful if anybody could help me!


This is the wrong direction situation

This is the right direction situation made manually by usign node Editor

maybe the parent constraint when scripted is not set to maintain offset? That’s why it nudges?

The ctrls look like they are aligning to the joints
I agree that is looks like the parent constraint is the problem
The script may be constraining objects in the wrong order
the order of node arguments in parentConstraint is (driver, driven):
cmds.parentConstraint(parent_node, child_node)

I’d check if you have that backwards

Great thanks for your answer, i have fixed this issue, but the reason why it works i’m still confused. Before, i connected attribute for each finger control and then group all those finger control under a new empty group. After i switch the execute order, i group them first, then i connect atttribute, this problem fixed.

Great thanks for your answer, i have fixed this issue, but the reason why it works i’m still confused. Before, i connected attribute for each finger control and then group all those finger control under a new empty group. After i switch the execute order, i group them first, then i connect atttribute, this problem fixed.