Right,
I have several problem while trying to make an expression evaluate when using the xform command.
Simple example:
Let's say I'm trying to "constrain" a cube (pCube1) to a vertex of another cube (pCube2) :
that doesn't work (for some obscure reason):
pCube1.translate = xform -q -t -ws pCube2.vtx[2]
;
but that does:
float $flot[] = xform -q -t -ws pCube2.vtx[2]
;
pCube1.translateX = $flot[0];
pCube1.translateY = $flot[1];
pCube1.translateZ = $flot[2];
Except that the expression only evaluate when time changes... does anyone have any idea why ?
Is there a workaround to this ?
Another little funny thing (is that a bug or am I being thick?) If you query an xform of a vertex it returns a double3, so (outside of an expression here), why can't you just do this :
setAttr pCube1.translate xform -q -t -ws pCube2.vtx[1]
;
why does Maya always give the following message ?
Error reading data element number 1
What is that supposed to mean ? Is that because the xform return value is a double3 and that the destination attribute is a float3 ? Isn't the conversion supposed to be automatic ?
NB :
setAttr pCube1.translate -type "double3" xform -q -t -ws pCube2.vtx[2]
;
or
setAttr pCube1.translate -type "float3" xform -q -t -ws pCube2.vtx[2]
;
return a different error message:
Error reading data element number 3
Please help, that is driving me mad.