# RuntimeError: setAttr: Error reading data element number 1: [(24.1303752966691, 1.4210854715202004e-13, 5.329070518200751e-15)] #
def FKstretch(self,limb,side,ctrlAttr,rigJnt,axis):
# create attribute
mc.addAttr(ctrlAttr,ln="stretch",at="double",min=0.1, max=3, dv=1,k=True)
mc.setAttr(ctrlAttr+".stretch")
# get primary axis length value
jntLength=mc.getAttr("{0}.t{1}".format(rigJnt,axis))
setFkMdn=mc.shadingNode("multiplyDivide", au=True,n="{0}_MDN".format(ctrlAttr))
mc.setAttr(setFkMdn+".operation",1) #set to multiply, just in case
mc.setAttr(setFkMdn+".input1X",jntLength)
mc.connectAttr(ctrlAttr+".stretch", setFkMdn+".input2X")
mc.connectAttr(setFkMdn+".outputX",rigJnt+".t{0}".format(axis))
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/da4bdd60-bb7c-4e98-bee7-ade06a63a58c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3BBdOrOs89kGep1Ssmz2fabrd7KQqGF3udP_N%2B%2BYaNgA%40mail.gmail.com.
mmc.setAttr(setFkMdn+".input1X",jntLength)
Eduardo: if the above is correct, I'll assume that the jntLength variable is the one getting the list. I tried adding the [0] at the end of it, but it returns a "TypeError: 'float" object has no attribute '__getitem__'
again, the odd thing is that it works perfectly well when it's the leg joints that need the stretch FK, but not the arms.