I am importing some values from an external txt file with python on geometry level. Now I am having issues to write the imported data as attribute (array) to use it with wrangle nodes later on. If I use point.setAttribValue() with a single float or integer value everything seems fine, but arrays won't work and I get an error (wrong attribute/data type).
The txt-File I'm importing looks like:
0;2 2;1;3 8;4;9 1;3 4;8;9 8;1 2;5;8;9 1 1;2;3;4;5;6;7
And my python operator like this:
geo = hou.pwd().geometry() conpoints = geo.addAttrib(hou.attribType.Point, "conpoints", 0) filePath = hou.pwd().evalParm("filePath") for line in open(filePath, 'r').readlines(): point = geo.createPoint() val = line.strip().split(';') point.setAttribValue(conpoints, val)
Is it possible to save arrays as point attributes with python?
Thanks!
mars