I tried making and auto ik snap system as a checkbutton in a custom attribute. Basically I wrote a function that snaps the rotation of some objects to some others. The function works fine, but when I make it the function happen whenever a certain object is moved using the "when transform $blah changes do" command, it only half works.
As I first start to move the "blah" object the snap happens but I can only move that object on one axis. The "blah" object's position correctly updates only when I begin to move it again.
In the online help, this example is given:
when transform $box01 changes do
$box02.pos = $box01.pos + delta
but when I evaluate it, it doesn't recognise the "delta" variable and without it, it doesn't evaluate correctly (the $box02 position doesn't match $box01's).
Should I be defining a "delta" variable for it to work correctly? Is putting a "when transform" statement inside a custom attribute going to give me grief? What's the best way to do this?