Hi, I am running a scriptJob that constrains the position of an object within a spherical region. I need to be able to translate the object, so I can’t really use any connections on its channels.
Instead, when the translate attribute changes, from the scriptJob I turn on the object’s translation limits - which are set to be equal to the coordinates of the end joint of an IK chain (made of 3 joints) that is point constrained to the object - move the object, and turn off the translation limits. This makes the object snap to the joint’s position, meaning it is within the sphere of radius equal to the IK chain length.
The script works perfectly, limiting the movement as desired; however, when I select a translate channel in the object’s channelbox to input a coordinate value, sometimes the scriptJob starts firing like crazy even though I have not changed the value yet; this makes it impossible to type a new coordinate, as the scriptJob interferes with the input. Other times the script only fires once I hit Enter and the channel’s new value is applied.
Needless to say, this is very inconsistent behaviour and I was wondering if there’s a workaround to avoid this problem.
Thank you.