Event
particle node
Generates events based on rules.
This operator lets you define a expression which, if it evaluates to true (non-zero) for an input particle, generates an event .
You can use events to trigger other POPs by using the popevent test function in their Activation fields.
Parameters
|
Activation |
Turns this node on and off. The node is only active if this value is greater than 0. This is useful to control the effect of this node with an expression. Note that this is activation of the node as a whole. You can’t use this parameter to deactivate the node for certain particles. |
||||||||
|
Source Group |
Only affect a group of points (created with, for example, a Group POP or Collision POP) out of all the points in the input. |
||||||||
|
Event Name |
Name of the event to generate |
||||||||
|
Predefined rules |
Use the items in this menu to fill in the Rule field with a predefined, commonly-used rule. Note
The list of predefined rules is specified by $HFS/houdini/POPEventRules.
|
||||||||
|
Rule |
An expression to evaluate for each input particle. If the expression evaluates to true (that is, non-zero) for a particle, the operator generates the event specified in the Event Name parameter. |
Local variables
Standard POP local variables
|
AGE |
The seconds a particle in the template has been alive. |
|
AX AY AZ |
Acceleration of the particle. |
|
BBX BBY BBZ |
The point’s relative position in the bounding box. |
|
DEAD |
Point is dead. |
|
ITER |
Processing iteration number. |
|
JUSTHIT |
A collision for this particle was detected (for example, by the Collision POP) during the processing of this timestep (that is, this iteration of the particle simulation). This variable is cleared at the beginning of each timestep. Note that the collision POP actually detects any collisions which would have occurred the during the previous frame. |
|
LIFE |
Percent of total life used (from 0 to 1). |
|
LIFESPAN |
Expected lifetime of particle. |
|
MAPU MAPV MAPW |
Point or vertex texture coordinates. |
|
NPT |
Total number of points. |
|
NGRP |
Total number of points in source group. |
|
NX NY NZ |
Normal vector. |
|
PT |
The point number of the currently processed point. The |
|
RESTX RESTY RESTZ |
The rest position. |
|
SLIDING |
The sliding state of the particle. |
|
SPRINGK |
Elasticity of a point. |
|
STOPPED |
Point is stopped. |
|
STUCK |
1 if particle is stuck to a collision object. |
|
TENSION |
Spring tension. |
|
TIMEINC |
Time increment. |
|
TX TY TZ |
Point position. |
|
U V |
Surface UV values. |
|
VX VY VZ |
Velocity direction. |
|
WEIGHT |
Point spline weight. |
Added by Collision POP/Limit POP
|
DIST |
Distance from particle to last collision. |
|
HCR HCG HCB |
Diffuse color at the collision point on the surface the particle collided with. |
|
HITID |
ID for last collision. You can control how this attribute is set in the Collision or Limit POP to help distinguish types of collisions. |
|
HITTIME |
The time at which the last collision occurred. |
|
HMAPU HMAPV |
The texture map UV coordinates for the surface location where the last collision occurred. |
|
HNX HNY HNZ |
The normal at the surface location where the last collision occurred. |
|
HTX HTY HTZ |
World space position of the last collision. |
|
HU HV |
The UV coordinates for the surface location where the last collision occurred. |
|
NUMHIT |
Number of times the particle has collided. |
Added by Color POP
|
CA |
Point or vertex alpha value. |
|
CR CG CB |
Diffuse point or vertex color. |
Added by Property POP
|
ATTRACT |
Attractor point. |
|
CHARGE |
Charge of the particle. |
|
CLING |
Point is clinging to geometry. |
|
DRAG |
Point drag. |
|
FOLLOW |
Leader to follow. |
|
MASS |
Point mass. |
|
PSCALE |
Particle Scale. |
|
SCALEX SCALEY SCALEZ |
Non-uniform scale. |
Added by Proximity POP
|
NEAREST |
Either the point number or id of the particle nearest to this one. |
|
NEARESTDIST |
The distance to the nearest particle. |
|
NUMPROXIMITY |
The number of particles within a specified proximity to this particle. |
Added by Rotation POP
|
ROTA |
Rotation angle. |
|
ROTX ROTY ROTZ |
Rotation axis. |
Added by Source POP
|
GEN |
Generation. |
|
ID |
ID number, which always remains constant. |
|
ORIGIN |
Original Source point was birthed from. |
|
PARENT |
Parent’s ID Number. |
Added by Speed Limit POP
|
SPEEDMAX |
Maximum speed. |
|
SPEEDMIN |
Minimum speed. |
Added by Sprite POP
|
SROT |
Sprite rotation around view axis (in degrees). |
|
STEXU STEXV |
Texture coordinate of sprite’s lower-left corner. |
|
STEXW STEXH |
Size of sprite in texture space. |
|
SX SY |
Sprite scale. |
Controlled by Suppress Rule POP
|
SUPPPOS |
Suppress default position rule. |
|
SUPPVEL |
Suppress default velocity rule. |
|
SUPPUP |
Suppress default up-vector rule. |
|
SUPPAGE |
Suppress default aging rule. |
|
SUPPROT |
1 if particle is suppressing its default rotation rule. |
|
SUPPANGVEL |
1 if particle is suppressing its default angular velocity rule. |
Added by Up Vector POP
|
PVX PVY PVZ |
Previous velocity. |
|
UPX UPY UPZ |
Up vector. |
Added by Location, Source, Softbody, Split POPs
|
SPEED |
Absolute speed of particle. |
Example files
Splatter
$HFS/houdini/help/examples/nodes/pop/event/Splatter.cmd
This example shows how to apply different behaviors when events happen. The particles fall from the sky onto the sphere and stick to the collision object. Only when a second particle strikes the sphere do the particles then fall off the sphere.
This effect is accomplished by having different POPs applied to the particles over time. Initially particles are birthed from the grid and a gravitation force is applied. Let’s take a look at the input selection rule in the Switch POP.
----- popevent(“release”) || popevent(“switch”) -----
The popevent() function returns a 1 when the event is occurring and 0 otherwise. So, this statement says that whenever the event “release” or “switch” occur, use input 1, otherwise use input 0. To start, none of these events are occurring, so the first branch is cooked.
So, to start, the particles are processed by collision1 which collides them against sphere2 and stops them on contact.
Now, let’s look at source2 and collision3. At frame 100, a single particle is birthed which travels towards the sphere. In the Collision POP, an event, “release” will be generated when the particle hits the sphere. The generation of this event will cause the switch to start evaluating the other branch.
Instead of being processed by collision1, the original particles will be processed by state1, collision2, and event1. The State POP will “unstick” the particles so that they will continue to move.
The Collision POP now collides them against the sphere again, this time bouncing them with no gain normal. This will cause the particles to slide off the sphere.
Finally, an Event POP is used to generate the “switch” event, which will cause this branch to continue to be evaluated.
Note that there are actually two collision spheres, sphere1 and sphere2. sphere1 is just a little bit bigger and is the first object to test for collision. This is so that when they are released, they will bounce off the slightly smaller sphere2. Otherwise, the particles might continue to stick even after they have been unstuck because they are right on the boundary of the collision object. By making the second sphere slightly smaller, this numerical accuracy issue is relieved.