I have it mainly working except for the logic part. This does nothing, but I know it's not totally broken because if I manually append a primpath to the includes array, that works...
string includes[] = {}; string collectionpath = usd_makecollectionpath(0, "/scene/geometry/tree_instancer", "everyOtherTree"); string name = usd_name(0, @primpath); int num = opdigits(name); if(num % 2 == 0) append(includes, @primpath); usd_setcollectionincludes(0, collectionpath, includes);
On the other hand this works as I would expect - every other prim receives a value of 1, the others -1:
int var = -1; string name = usd_name(0, @primpath); int num = opdigits(name); if(num % 2 == 0) var = 1; i@primvars:num = var;
both are operating on the same set of prims - /scene/geometry/tree_instancer/tree*
Can anyone tell me where I'm going wrong?