I'm assigning texture names from an array to objects based on their point number in houdini like so:
string textureVariantBase[] = {"paint_a","paint_b","paint_c"};
i@idGrid = @ptnum;
int mapNum = i@idGrid % 3;
s@textureCol = textureVariantBase[mapNum];
..then just using <attr:textureCol>.tx in the shader.
I'm trying to find the equivalent way to achieve this with operators. It seems that foo[bar] isn't allowed as it looks for a number, is this correct? I did see the 'attr:index' token as a possible solution, but couldn't get this working either (I'm not sure how to assign a 'uint' in houdini) - but I'd prefer to build the texture name string inside a setParameter and then just keep the simpler texture token as it is in the shader.
I don't think you can something equivalent with operators and no vex.
You could create the textureVariantBase user data with an operator, but you couldn't select from it the same way. Because while you can use the modulo operator, you can't get a "ptnum"
You could use set_parameter to create uint user data, but you cannot create uniform (per face) user data.
PS For indexed facesets, you need to get HtoA to send this to Arnold:
polymesh { nsides 4 1 UINT 4 4 4 4 declare facesets constant ARRAY STRING facesets 4 1 STRING "a" "b" "c" "d" declare faceset_id uniform UINT faceset_id 4 1 UINT 3 2 0 1 } image { # matches e.g. tex-b.jpg filename "tex-<attr:facesets index:faceset_id>.jpg" }