I've got 2 curves merged together for a total therefore 2 primitives. I'm trying to make a detail array attribute storing all the positions of all the curves (I'll be adding more curves later). I'm getting no errors but the detail array is still empty…
You're very close! Your condition in the for loop is currently i==stop, meaning the loop will run as long as i==stop returns true. When the loop starts, i=0 which is not equal to stop (in your example stop would be equal to 2 and in all cases would be greater than 0). I guess it technically isn't incorrect code is why it doesn't error out but it doesn't run as expected.
I kept thinking of a “stop” condition rather than a “continue while” condition…
The other thing not working was my line:
intstop = @numprim;
…It's in a detail wrangle so it did not find the @numprim. I also tried using:
intstop = prim(0, "numprim", 0);
…but that gave me “0” instead of “2”. I still don't get that problem. So I ended up creating a primitive wrangle just before and using the setdetailattrib so my numprim would be in the detail attributes. From there, I was able to use that value.
So much troubleshooting for so little effect. Thanks for the help!