I am currently having an issue when trying to populate an array attribute with a lop wrangle set to `Run on Elements of Array Attributes` and Array length set to `Specific Attribute`.
In some cases it works fine but many times it just runs over exactly 1024 elements and ignores the rest.
What I am trying to accomplish is creating a Point and Prim ID Attribute per USD Prim in Lops for import into sops to later be able to map the points back to the original one for sparse attribute overrides(don't want to do the id generation in Sops since i would have to unpack :S) - If there are better ways of accomplishing that please let me know as well
My first try to do this was in a for loop in a wrangle but that is very slow since it wont be multithreaded (at least not if there is only one primpath) and that is why I am trying to use the `Run on Elements of Array attribute`.
These are the wrangles I use:
First a wrangle that is running normally over all Prims of type mesh:
string prim_id_attrib = "prim_id"; int primcount = usd_attriblen(0, s@primpath, "faceVertexCount"); if(primcount == 0) primcount = usd_attriblen(0, s@primpath, "curveVertexCount"); int prim_ids[]; resize(prim_ids, primcount); usd_addprimvar(0, s@primpath, prim_id_attrib, "int[]", "uniform"); usd_setprimvar(0, s@primpath, prim_id_attrib, prim_ids);
Then the second wrangle that causes the problems:
- It is also running over all primitives of type Mesh
- Toggled `Run on Elements of Array Attributes`
- Array length is set to `Specific Attribute`
- Attribute Name is set to prim_id
and the code itself is this:
string prim_id_attrib = "prim_id"; usd_setprimvarelement(0, s@primpath, @elemnum, @elemnum);
Any help is greatly appreciated and thanks in advance