Align object's pivot to other object in Python


#1

Hi,

I’m rather new to Maya scripting and not sure how to translate some nodes I built to PyMEL/Python.

My node network looks like this:


Pivot Align

The part I didn’t manage to translate to PyMel yet is setting the Rotate Pivot of AnkleRotationHiddenCtrl.

Basically what I’m doing is setting AnkleRotationHiddenCtrl’s pivot to AnkleBendCtrl’s world position by calculating the relative offset of AnkleBendCtrl’s world position to AnkleRotationHiddenCtrl’s world position without the pivot offset (the plusMinusAverage node is set to subtract).

How do I build these point constraints in pymel? Or is there another way of recalculating the pivot position in every update?

Thanks!