Hi Olaf,
Thanks for your reply. Your suggestion to use a TableImport node would work, however there will be several dozen instances of this hda each one would require its own file… (not so good) or one big file (which I would have to parse (also not so good)).
What I am trying to do is set the orientation of a few points by inputing the Euler rotation data by hand (to automate this would be more painful). Since the number of points changes from about 4 to about 12 the key-value data structure seemed the better option. The key is the point number and the value is a comma separated list of vector components and an angle.
The data can be read in as one long string so in the end I wrote a short bit of Vex to split the string. If anything about the internal representation of the data string changes the code will break so its not the best of solutions. For the benefit of anyone else trying to use the key-value parameter I have included my code below (it will need to be edited according if the key data or value data are different to mine.
thanks again,
Richard.
“kvDict” is the name of key-value parameter.
string kvd=ch("../kvDict");
string kvpair[];
string svec[];
vector nm;
vector4 quat;
string socks[] = split(kvd,"\n");
for(int i=1; i<min(len(socks)-1,120); i++)
{
// split pairs at ":"
kvpair=split(socks[i],":");
// Strip whitespace and string quotes
kvpair[0]=strip(kvpair[0]);
kvpair[0]=strip(kvpair[0],"\"");
// Strip whitespace and string quotes
kvpair[1]=strip(kvpair[1]);
kvpair[1]=strip(rstrip(kvpair[1],","),"\"");
svec=split(kvpair[1],",");
nm = normalize(set(atof(svec[0]),atof(svec[1]),atof(svec[2])));
quat = quaternion(radians(atof(svec[3])),nm);
setpointattrib(0,"orient",atoi(kvpair[0]),quat,"set");
setpointattrib(0,"socket",atoi(kvpair[0]),"post","set");
}