Force custom point number

   10839   12   3
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
hi
simple description
I've got a particle system that has 100 points
over the course of 100 frames each particle is killed by a split POP and a new particle is created
the result is that there are always 100 particles - but their point # changes over the 100 frames and their id # come and go…
what I'd like is to have a consistent point #
point 0 is always point 0 etc

copying stuff to this particle system causes pops all over the place - I've tried a few things with the ORIGIN attribute etc but nothing has worked….

thanks
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
861 posts
Joined: Oct. 2008
Offline
Here is an idea that could be implemented in Python.

-make an “available id list”
-make a “used id list”
-assign an id from available list to the new point and put its id from “available” to “used”
-if particle dies, move its id back to “available id list”

I haven't used Python in pops though and I don't know if there are any pitfalls (maybe we cant easily assign attributes when particles are born or die)
--
Jobless
User Avatar
Member
861 posts
Joined: Oct. 2008
Offline
It's trickier than I thought. There seems to be no python in pops, and in sops it appears we can't write and read from attributes at the same time, complicating the whole thing quite a bit.

This whole problem of changing point ids keeps coming up again and again (for me at least) and it would be nice to have a truly unique id identifier available in Houdini.
--
Jobless
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Ahh the old point count changing.Off the top of my head why kill the initial particles. Could they be stuffed into group and hidden ? . That way the point count will not change from the initial $ID

Rob
Edited by - Feb. 25, 2011 14:29:14
Gone fishing
User Avatar
Member
401 posts
Joined:
Offline
circusmonkey
Ahh the old point count changing.Off the top of my head why kill the initial particles. Could they be stuffed into group and hidden ? . That way the point could will not change from the initial $ID

Rob

I guess because it will be getting ridiculously slow after a couple of frames?
Not sure what this setup is about, so it's hard to suggest alternatives.

One way though to keep the point numbers down is:
Don't kill them right away but every other frame. And proximity or bruteforce lookup between the new and old particles to tranfer your “custom id” attribute.

But then I'm not really sure I understand what's going on at all
this is not a science fair.
User Avatar
Member
731 posts
Joined: Dec. 2006
Offline
Can you post an example that shows the popping? I've got a few different ways of dealing with this thorny issue.
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Here.

Attachments:
kill_splits_with_constistent_sort.hip (59.9 KB)

There's at least one school like the old school!
User Avatar
Member
401 posts
Joined:
Offline
That's pretty cool.

Now I just need to understand why I would want to split a killed particle …
this is not a science fair.
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
It's one way to reset the age or trigger an event. There are other methods as well.

You can also take advantage of the fact that with a Split POP along with a Source POP, you now have two different particle primitives so again it makes it convenient to aggregate original particles from split particles without having to add attributes or groups which can get expensive when you have millions of particles. Remember every attribute you add to a point takes up memory. Add a vector attribute and it's like adding another set of points wrt memory.
There's at least one school like the old school!
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
thanks jeff…
I had something similar going already…but the issue persists…

here is a very simple example with your method:
everything seems to be correct but the particles system is fluctuating between 98-101 particles - making the copy pop…

the real system I'm making takes scattered particles on deforming geometry and, based on the speed of a particle detaches it from the original (via the split)…
imagine leaves on a tree (this is just an example - not what I'm doing)
they are placed on the branch using a position pop
as the branches are moved by wind the leaves enter a ‘fast’ group
this group is killed with a split and the new particle is free to be affected by the wind force

thanks for the help so far

Attachments:
kill_splits_fail.0.hip (126.3 KB)

Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
731 posts
Joined: Dec. 2006
Offline
If you make the “new” group persistent, and only copy geo to members of this group, then you get no popping. Then you could just copy geo to the source group, and delete this geo as it enters the birth group, (using CHOPs to make this group persistent….haven't done that in my example).

If you need the birthed geo to exactly match the template geo, you could pass scale and orientation info on to POPs and then re-extract it on copy.

This of course doesn't solve the changing point count/copy problem, but I'm not sure if it's solvable in this situation. It makes my head hurt.

Attachments:
kill_splits_fail.0_971.hip (143.4 KB)

Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
'solved' this by not using split…

using a custom OP that creates a $STUCK attrib at SOP level then using the State POP to change this to “0” when needed….
seems to work just fine…

not happy about the split pop though….great for big wacky particle system but not so great for precision work…
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
67 posts
Joined: May 2014
Offline
Hi guys,

Hope you guys don't mind me bringing this thread back.

I am trying the same setup as Jeff, but the sorting by expression doesn't work .

I am using just normal points, is that issue?

Please see the attached file.

BEst,
Cris

Attachments:
point_sort_by_id.hip (131.4 KB)

  • Quick Links