trying to count number of points in group using pop wrangle.
2190
3
0
jean_marc
Member
13 posts
Joined: Nov. 2013
Offline
July 19, 2019 8:03 a.m.
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)
Andr
Member
900 posts
Joined: Feb. 2016
Offline
July 19, 2019 9:02 a.m.
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
Andr
Member
900 posts
Joined: Feb. 2016
Offline
July 19, 2019 9:06 a.m.
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
jean_marc
Member
13 posts
Joined: Nov. 2013
Offline
July 19, 2019 10:41 a.m.
ok thanks , that seems to work, if i setup a wrangle after the popnet, i can read it .