I need a help to sort out.
I did a test to add an attribute of type doubleArray, and then assign values to it.
But I got an unexpected result in MEL version, while got a correct one in python/ pymel
below are the MEL version
createNode null -n "myNode";
addAttr -ln "value" -dt doubleArray;
setAttr "myNode.value" -type doubleArray 1.0 2.1 3.1;
print `getAttr myNode.value`;
// Warning: Unrecognized node type 'null'; preserving node information during this session. //
The result output only 1 number instead of 3.
Later, I tried to change the 3rd line to setAttr "myNode.value" -type doubleArray 2.0 2.1 3.1;
and run the 4th line again, and the result turned to...
As showed above, the 1st value I gave was always ignored for unknown reason, and the rest ones were correctly output as long as the 1st value is >= 2.0.
Lastly, I did same thing in python/ pymel, and it output as my expectation.
## python/ pymel
from pymel.core import *
import maya.cmds as mc
mc.createNode( 'null', n='myNode')
mc.addAttr( longName='value', dt='doubleArray' )
PyNode('myNode').value.set( [1.0, 1.1, 1.2] )
// [1.0, 1.1000000000000001, 1.2]
Could anyone do me a favor to explain what's going on with my 3 test? Thanks!