Jump to content

Pop Group Point Count


henderthing

Recommended Posts

Hello-

I'm using the group POP to create groups using the rand tab according to the rule $PARENT. This is working out great, but requires for me to know how many parents there are--(how many numbered groups I wish to create).

For the first iteration, which comes from a SOP group, I can use:

argc(pointlist("SOP",groupname))

to get the number of new groups I'll be creating in my POP. However,

after that, with every split I'd like to use, this expression does not

work. Is there a way to query the number of points in a POP group?

How about a way to find out, given a group of points, how many parents

there are among them?

-m

Link to comment
Share on other sites

In the Attribute POP, set the source group to be the group you want to count the points in.

In the value field, put $NGRP.

Warning, sidetrack.....

I also tried something a bit tricky. I appended a Null SOP to the POP Network SOP and tried to point the pointlist() expression at that. I got the correct value in the value field but the attribute was empty.

Perhaps flirting with recursion... :huh:

In this second case, the Null SOP simply caches the results of the POP network's previous timestep and it "should" be fine to reference anything in SOPs downstream from the current POP SOP.

Link to comment
Share on other sites

In the Attribute POP, set the source group to be the group you want to count the points in.

In the value field, put $NGRP.

Warning, sidetrack.....

I also tried something a bit tricky.  I appended a Null SOP to the POP Network SOP and tried to point the pointlist() expression at that. I got the correct value in the value field but the attribute was empty.

Perhaps flirting with recursion...  :huh:

In this second case, the Null SOP simply caches the results of the POP network's previous timestep and it "should" be fine to reference anything in SOPs downstream from the current POP SOP.

22141[/snapback]

AARGH! Thank you. I don't know how many times I scanned local variables for POP nodes without seeing $NGRP!!! Since I posted this, I realized that I didn't need to have the group count within POPs, as all I'm using those particular groups for is to draw lines between particles with the Add SOP. I ended up using the Partition SOP instead, which doesn't require a point count.

Thanks again. This will come in handy.

-m

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...