Hi guys, i have this simple vex-code here. The if-loop gets called two times, so just two points should be added, but for some reasons hundreds get added. Its pretty straight-forward, what am i missing? Starring for two hours at this and cant find my mistake. In Attribute Wrangle, with Group: Points and Run over: Points. The attribute choosenInt is there too with the right numbers.
It works with npoints(0) instead of @ptnum together with Run Over: Detailed. Although printf gave me just two prints the paralell working of points must have started the loop as often as i have points. So 73 times and every time 2 points were added. Still strange, i would have thought Printf would give me a message every time.
i would have thought Printf would give me a message every time.
In detail mode with npoints(0) instead of @ptnum you will get a printf output for every point that has an attribute value of 2 for ‘choosenInt’ and the same number of new points.
In Detail-mode everything is as expected. What i meant was the printf in my first post(Run over points). Addpoint fires a few hundred times but printf just twice(2 is twice in chooseInt), which is weird i think. Cause they share the same if-loop-body.
I think that's because the compiler is being ‘smart’, those values for printf, in your case are coming from only two points, and the values are not changing.
So there's no need to repeat the output more than once for each one.
However, although it's not what you intended, your creating multiple points for those same values, so Houdini does that because it's geometry and that's what you specified.
I also saw this on Odforce from edward:
VEX multithreads in buckets of 1024 elements. So because your printf is not varying, it only prints once per 1024 elements.
So just to see, try to multiply your source so you get multiples of 1024 and you should see the printf printing twice * multiples of those ‘bucket’ sets of 1024.