trying to count number of points in group using pop wrangle.

   2190   3   0
User Avatar
Member
13 posts
Joined: Nov. 2013
Offline
hi,
I have setup a simple popnet as a test and using a pop wrangle I'm setting all points as they spawn to a group called test. I then try and read the number of points from this group using npointsgroup. I can see there are 1000's of points in the “test” group by getting info on the wrangle node but npointgroup always return a big fat 0.

its something simple, just not seeing it.

cheers marc.

setpointgroup(0, "test", @ptnum, 1, "set");
int j = npointsgroup(0,"test");
printf("%i", j);
Edited by jean_marc - July 19, 2019 08:04:33

Attachments:
test.hipnc (226.9 KB)

User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
I don't have much experience with particles, but this is probably happening because you are setting and reading back in the same wrangle.

If you use two wrangles, one for setting the group and the following to read the group back, you should be able to read the correct value
Edited by Andr - July 19, 2019 09:03:21
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
npointsgroup(0,"test");

The ‘0’ is the input 0. So you are trying to read from input 0, which in your case doesn't have any group set.
Edited by Andr - July 19, 2019 09:06:15
User Avatar
Member
13 posts
Joined: Nov. 2013
Offline
ok thanks , that seems to work, if i setup a wrangle after the popnet, i can read it .
  • Quick Links