I’m trying to change my constraint offset using the following code (i.e. PyMel):
constraint = pm.ls("IKLegFront1_R_parentConstraint1") constraint.target.attr("targetOffsetRotateY").set(130)
It gives me an error of
A child attribute of 'IKLegFront1_R_parentConstraint1.target' is locked or connected and cannot be modified. #
I can access it but I can’t modify it. The attribute is also not locked nor connected to anything else.
Interestingly, I ran the same command in CMDS and MEL and it works as expected.
constraint = cmds.ls("IKLegFront1_R_parentConstraint1") cmds.setAttr(constraint + '.target.targetOffsetRotateY', 120)
setAttr "IKLegFront1_R_parentConstraint1.target.targetOffsetRotateY" 130;
May I ask what am I missing for the PyMel implementation?