Jump to content

Kill particle if born from same point as previous particle


ganzo

Recommended Posts

I have a small problem I have been unable to solve. I am feeding a group of points (not in group got deleted) that get fed into a pop network. Since the groups contents changes every frame (thus point numbers) I created an attribute to hold the original point numbers called orig_point. So even though the grouped points might have a different point number...they still hold the original point data they came from. I feed this into pops and I am running through the ptnums in vops (for loop)and checking if the current evaluated particle has an orig_point value equivalent to a previous particle (for counter)....and my intention is to delete such a particle if it was born from the same original point. Although thus far I have been unable to do so....any ideas?

Link to comment
Share on other sites

Could you elaborate a bit on that? I honestly have never used sopsolver so wouldnt even know where to start. I wanted to kinda keep a history of the activated points...kind of like how you keep a birthgroup and add to it. Or possibly somehow mark those points as dirty

Link to comment
Share on other sites

Other solutions, even faster, could be to delete those particles inside your POP network or exclude the points that have already generated particles before entering in POP.

Thanks Emanuele,

works like a charm...very helpful indeed, although I wanted to get a more procedural approach to this problem. I actually tried to delete the particles within my pop network, but lets say that at each timestep 10 particles were created...I could only delete the last particle if it was a duplicate..I could not delete the other duplicates.

"exclude the points that have already generated particles before entering in POP." I originally tried this, but I could not keep a historical record of the points....how can I add points to a group node the way a pop birth group works? Or some way of keeping a permanent record that does not change over time? Sort of the way your list works in python to feed to the delete?

Link to comment
Share on other sites

Thanks anim,

I guess that is the pre pop approach to delete points that have already been activated.

I'm still new to the sop solver node, but from what I am seeing is that it does keep record of things from the previous frame am I right? Could you explain the group nodes inside the sop solver? The first "was active" brings in the data from the previous frame right? And the last "was active" updates the group contents at current frame? Is the "was_active" group the only one that has data being added to at each time step? Sorry, just trying to get my head around this...still new and tutoring is always appreciated :D

Link to comment
Share on other sites

I thought my solution was totally procedural, even with substeps...

Am I wrong?

Ha ha sorry Emanuele, did not mean it that way :P I meant it more of staying with what I could do just with nodes and not go into python. Although I must admit that your solution has given me new insight of what I can accomplish with python in houdini. I had used it for basic channel exports and such, but this really expands my options in the future..so thanks for that!

Link to comment
Share on other sites

a little explanation of nodes inside SOP Solver

object_merge_points - just brings live geometry in, nothing simulated, it contains your "active" group (with 0 or more points)

dop_geometry - brings previous frame geometry from DOPs (default node in SOP Solver)

groupcopy_was_active - copies "was_active" group to live geometry

group_source - substracts "was_active" from "active" (so that no points that were active in the past could be used again) and stores it in new "source" group, because we will need "active" group later

group_was_active - appends "active" group to "was_active" so it can be used in the next frame (timestep)

it is then read again through dop_geometry node and copied to live geometry and so on

Link to comment
Share on other sites

...

Seems this is one of the few ways to keep history on attributes.

...

every technique in Houdini is one of a few, here are the others you can use for that (and maybe I am missing some):

SOP Solver DOP has the advantage that the result can be automatically cached into memory

and it can be multithreaded to some extend if you use VOPs inside, but I am not sure how much speed you can get since Object Merge SOP is probably singlethreaded

POPs are great way of keeping history too, so you can fly it through POPs before using the result in another POP network almost the same way as through SOP Solver (and you can use VOPs too to speed things up)

You can also use CHOPs to accumulate attribute over time and do some magic inside which is not possible in frame by frame accumulators, since in CHOPs you can work with the whole animation curve at once

There is also Feedback SOP, currently unsupported, but you can install it through protoinstall and I find it very useful sometimes

and of course the old-school method by writing geometry to disk and reading back the previous file from disk next step

it may be not used very often in SOPs nowadays, but this is invaluable in COPs

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