Age of particles in a group

   8632   6   2
User Avatar
Member
28 posts
Joined: Dec. 2012
Offline
Hey, me again.

So general question - I'm grouping particles with a popgroup DOP. I'd like to capture the frame, or the age, or some information relating to when the particular particle becomes part of a group. How could I go about doing this? If I can't do it with groups how else would I acheive this? It's like I need to flag an event per-particle so it can smoothly transition from one state to another.

Cheers
User Avatar
Member
133 posts
Joined: July 2005
Offline
Do you mean you want to store the frame on which a particle changed some sort of attribute? Like a trigger frame?
Francisco Rodriguez
Effects Animator | Walt Disney Animation Studios
User Avatar
Member
28 posts
Joined: Dec. 2012
Offline
Yes indeedy - since posting this I've been looking at collision detection POPs and I'm making some progress, but any pointers would be helpful.
User Avatar
Member
8548 posts
Joined: July 2007
Online
you can either create custom attribute that accumulates the age particle has spent in certain group/stream
http://forums.odforce.net/topic/20755-wrangle-reset-particle-age-when-the-particle-enters-a-group/?p=124254 [forums.odforce.net]

or maybe even use f@hittime if it's really about collision
hittime attributes stores time of the last collision (generated by POP Collision Detect, or Add Hit Attributes on POP Solver)
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
133 posts
Joined: July 2005
Offline
Hey!

Sorry it took so long. This is a multi-purpose trigger technique I use all the time. Uses some simple VEXpressions. I hope you're comfortable with those. It's all commented for you.

The gist of it is this:
1. Store a ‘control’ and ‘active’ attribute, both equal to 0, on the source geometry.
2. Put your particles in a group, according to any method you like. In my case, I'm using a bounding sphere.
3. ‘Activate’ the particles by setting the attribute to 1 when they're in the group.
4. Once the particle is ‘active’, then it'll be greater than the ‘control’ value. At this point, store the active frame.

Now that the points have an ‘active_frame’ attribute, you can compare that with the current frame and do something cool. In my case, I just color the points red.

Feel free to ask any questions!

Attachments:
activate.v03.hipnc (230.9 KB)

Francisco Rodriguez
Effects Animator | Walt Disney Animation Studios
User Avatar
Member
28 posts
Joined: Dec. 2012
Offline
That is awesome Francisco, thank you very much! That looks like a trick I'll be using for years to come. Really cool. Thanks for your help as well, Tomas.
User Avatar
Member
133 posts
Joined: July 2005
Offline
You're very welcome!

You can also do this using a multi-solver with a SOP solver tied in. But, that's a little convoluted. The vex snippet is much more compact and elegant and probably faster.
Francisco Rodriguez
Effects Animator | Walt Disney Animation Studios
  • Quick Links