Jump to content

POP Group Center


dxhhx

Recommended Posts

Hey guys,

 

Hopefully this is a quick one. I was wondering how I could find the average position of a group of particles (and store the position as an attribute on the particles in that group)?

Say I have two groups, A and B, and I want to find the average position of the particles in group A and create a force on the particles in group B to go towards that point (center of A), and at the same time have all the particles in group A move towards center of B.

POP Group A -> Center of POP Group B

POP Group B -> Center of POP Group A

 

Thanks :)

 

Link to comment
Share on other sites

Hey thanks for the file David! Haven't even crossed my mind to bring it into a SOP Solver. Would have liked to have access to the average position attribute for use with the POP Solver, but this will work for what I need.

 

Btw I tried to see if I can replace your "detail_avg_pos" wrangle with two attribpromote, but it doesn't seem to work. Do you have any idea why?

 

Thanks again, much appreciated :)

 

pop_avg_p_002.hip

Edited by dxhhx
Link to comment
Share on other sites

it's not working because when you are blasting the groups, the points still have both detail attributes on them from the previous frame but each blast only computes one. Since we are working with detail attributes and can only have one value per attribute,  the values from the left input of the merge are taking priority.  

I don't see why you can't use these attributes with other pop solver nodes, you can access it as a detail attribute or promote it to the point level every frame if that's easier.

Edited by dchow1992
  • Like 1
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...