Justin: I believe the error returns on this line
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.
On Tuesday, October 14, 2014 10:24:09 PM UTC-4, flaye wrote:
>
> I get this error, and haven't been able to find the source of it. Is it
> way Python interprets the numbers for Y & Z?
>
>
> # RuntimeError: setAttr: Error reading data element number 1:
> [(24.1303752966691, 1.4210854715202004e-13, 5.329070518200751e-15)] #
>
>
> Here's the method that generates it:
>
>
> 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))
>
>
> The strange thing is that this method works perfectly fine when called by
> the legs joints, but not by the arms. The code is identical for both.
>
> thanks
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/896b241c-6807-4838-8028-315d646510b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.