Vex and key-value interface parameters

Hi,Anyone know how(or even, if it's possible ) to read a key-value dictionary parameter using Vex? I such a parameter variable on the wrangles Parameter Interface but not sure what data type to declare it eg a string: string kvd[] = ch("../kvDict")? The latter seems to read it in but seems to contain special characters (carriage return) so parsing it might be difficult.

Hi Richard,what is it you want to do/achieve with this?Do want to parse a text file? Do you want to manually input a number of values?Do you have a .HIP file where we can see what you want to do? Please upload a simplified version of your issue as a hip file.BTW: I think the answer to your first question is: yes.

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 Tamte,I agree a dictionary data structure is very natural to python, but then I have to get fluent with Python in Houdini - it's on my list - but was holding out in case there was a “simple” solution.