Force custom point number
10839 12 3- goldfarb
- 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
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
- Soothsayer
- 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)
-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
Jobless
- Soothsayer
- 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.
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
Jobless
- circusmonkey
- Member
- 2624 posts
- Joined: Aug. 2006
- Offline
- rdg
- 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.
- mrCatfish
- Member
- 731 posts
- Joined: Dec. 2006
- Offline
- old_school
- Staff
- 2540 posts
- Joined: July 2005
- Offline
- rdg
- Member
- 401 posts
- Joined:
- Offline
- old_school
- 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.
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!
- goldfarb
- 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
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
- mrCatfish
- 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.
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.
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
CG Supervisor
Machine FX - Cinesite MTL
- goldfarb
- Staff
- 3455 posts
- Joined: July 2005
- Offline
- cgcris
- Member
- 67 posts
- Joined: May 2014
- Offline
-
- Quick Links