Hamilton Meathouse
vector value = usd_primvarelement(0, @primpath, "displayColor", 3); //Gets the third element in the array
usd_addprimvar(0, @primpath, "myval", "vector");
usd_setprimvar(0, @primpath, "myval", value);
That's not python. Is it hscript or vex? I've tried implementing this "usd_addprimvar" as hscript without success. I suspect this is vex meant for use in a wrangle.
... found the doc's for it - yeah, that's vex. This will be useful for when I need to work with a wrangle. Thank you.
Of course, I still haven't found a way to get a value from an array primvar into a parameter. At least not directly. I did come up with a workaround. The attribute I'm trying to access was created in a sopmodify node, so I just split the array into individual float attributes - these I know how to fetch. If you have a pre-existing array primvar whose values you need to fetch, I expect you could push this into a sopmodify node and, there, split the array to individual floats so that they are accessible downstream but... this really shouldn't be necessary.