For each prim I scatter a number of points. Still within the foreach loop, I run a point wrangle on those scatter points. In the wrangle I run intersect on each of the scatter points and if one hits I set an attribute on the prim (foreach loop piece) that the points were scattered on. In the end I don't need the scattered points, I just need the prims output with the attribute @keepage updated.
What I cant figure out is how to set up the forloop so that this works.
Obviously this loop will output points. The VEX for the wrangle “secondaryIntersect” seems valid, but I have no way of applying changes to the attribute keepage on the Forloop's iteration pieces (primitives).
VEX for “secondaryIntersect” running over primitives.
vector p; vector hitprimuvw; vector srcpt; i@ptrefprim = prim(2, "refprim", 0); srcpt = v@P + (normalize(v@rdir)*2); i@hitprim = intersect(1, srcpt, v@rdir, p, hitprimuvw); if(@hitprim<5){ setprimattrib(2, "keepage", 0, 1, "set"); }
This makes me think my approach is not possible.
https://www.sidefx.com/forum/topic/42999/ [sidefx.com]