Jump to content

Using the neighbour vop


Recommended Posts

I am trying to use a vopsop to go through each point in my geometry and get the point positions of each point's neighbours connected via an edge. I want to store this information somehow (initial thinking is with a point attribute) so that I can use it later.

My problem is that I don't know how in houdini I can store array per point information as an attibute.

I have attached a scene file in which for each point on the source geometry I use vops to first get the number of connected neighbours and then cycle through these neighbours and get their id. Thing is one I am in the for loop which I have called "for_loopThroughNeighbours", I don't know how I store each loop's data. I end up being left with only the result of the last loop stored in my "foo" attribute.

Any thoughts or suggestions would be great!

Cheers.

storePointNeighbourVectorsAsAttribute.hipnc

Link to comment
Share on other sites

If you wanna save an array in vop you must use inline node or pure vex code. As far as I know it's imposible to save array of attributes in VOP without inline. It's really very uncomfortable.

void addattribute(string name; float values[]; int capacity, ...)

Edited by vi_rus
Link to comment
Share on other sites

  • 2 weeks later...

Thanks for the info, I started looking down that route and then found a nice way to get the neighbour information stored without using the inline cpp node.

I am now however not sure how best to use the data to do what I want to do.

I have the following data stored for each point:

neighbour count

neighbour ids

max number of neighbours for whole geo

direction to neighbour

I want to take this data into pops and do the following:

1.) birth a particle for each point in a "birthGroup" in the incoming geo.

2.) For each of those particles in the birthGroup I want to check how many neighbours each particle has and spawn that many particles.

3.) I want to fire these newly spawned particles in the direction of the neighbours.

4.) When each of these newly spawned particles gets to the neighbour point it has been fired at, I want to set their velocity to zero.

5.) Once a particle reaches a new neighbour that has not already been visited, I want to trigger the spawning of more particles in the direction of the neighbours for the neighbouring point we have reached, such that the effect propagates.

And the particle edge tracing effect continues.

I'm not very familiar with POPs. Anyone want to have a stab at that part?

I have the required data stored as attributes already (see attached hip file)

wireframeParticleTracer_v01.hip

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...