Ok I’ve done a little python script that controls the transform limits for translate y.
import maya.cmds as cmds
def forAtrrChange():
theYVal = cmds.getAttr(“pCube1.ty”)
if theYVal >= 0:
cmds.transformLimits(“pCube1”, ety=(False, False))
else:
cmds.transformLimits(“pCube1”, ty=(-1 , 0), ety=(True, False))
cmds.scriptJob(attributeChange=[“pCube1.translate”, forAtrrChange])
The minimum value of the transform limit is activated when the translate y value is below zero. While this can show you how you can relate a certain event to the transform limits or any other transformation value, this script doesn’t add much functionality. You can get the same behavior by simply add the transform limit in the first place. See if you can adapt this script to your rig structure, by controlling the stretch attribute via the translate y or other factor.
If you want to get rid of the scriptJob just run the following line:
cmds.scriptJob(killAll=True, force=True)
All this script lines are made in Python so run them in the appropriate script editor tab.