Reading Point count from a group

   9680   8   1
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hi all ,
In the source pop you can read in the point count from a SOP in the birth parameter using npoints , is there any way I can read into the birth rate the point count from a group at the sop level ?

regards r
Gone fishing
User Avatar
Staff
809 posts
Joined: July 2006
Offline
It's probably slow, but something like:

argc(pointlist(chs(“soppath”),chs(“source”)))

should work.
User Avatar
Member
4256 posts
Joined: July 2005
Offline
Or alternatively just append a Blast SOP to the Group and delete everything but that group. Then just use the npoints() expression. No harm in using extra SOPs to do your work for you.

If the geometry isn't changing over time then the Blast SOP will be cached so the npoints() expression will be nice and quick.
if(coffees<2,round(float),float)
User Avatar
Staff
809 posts
Joined: July 2006
Offline
Yeah, I thought maybe this was for an asset or something where the SOP and group name in question are entered directly as parameters. In that case a SOP-oriented solution could still work, but you'd probably want to embed a SOP network in the POPNet, ObjectMerge in the SOP in question, do the Blast and then reference that embedded SOP from the npoints expression.
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Using the blast technique of course is well proven.I was just looking for something more elegant as I have a crowd of 60k to deal with and lots of shots where it would be nice for the shot maker to pull in which ever group he needs

r
Gone fishing
User Avatar
Member
4256 posts
Joined: July 2005
Offline
Ah! I see. Yea aside from making a nprimsgroup() and npointsgroup() I think johner's suggestion is the best one. I tried doing an equivalent expression in hython but it runs about 5 times slower.
if(coffees<2,round(float),float)
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Thanks so much for the ideas guys .

r
Gone fishing
User Avatar
Member
339 posts
Joined: June 2013
Online
Hi guys, necropost here because I was looking for a solution for this.

Best I found was to set an attribute like i@check = 1 ; for the points belonging to the group and then do Attribute Promote to detail with sum.
This was faster than Blast SOP check, especially in a loop.


Let me know if there's an even faster one!

Cheers.
Edited by probiner - Feb. 7, 2018 15:41:44
User Avatar
Member
39 posts
Joined: July 2013
Offline
Looks like the npointsgroup vex expression does the job, unless I'm mis-understanding the question (I probably am)

http://www.sidefx.com/docs/houdini/vex/functions/npointsgroup.html [www.sidefx.com]
  • Quick Links