Houdini 12 VEX VEX contexts

Define a custom POP operator with a program that edits particle attributes.

The POP context has the same variables and functions as the SOP context. Both of these contexts allow processing of point attribute data. With the POP context, the points are typically used in a particle system, however, this is not a requirement of the context. In general, a function written for POPs will work as a SOP or vice versa.

Export variables in the POP/SOP contexts will cause new attributes to be created on the geometry. The attribute will have the name and size of the export variable.

Globals

Cd

Color (RGB) of the current point.

Time (read-only)

Current time (in seconds).

accel

Acceleration of the current point.

Pw

Point weight.

life

Expected lifetime (in seconds) of the current point. A particle can die earlier than expected if a collision or some other event occurs.

P

Position of the current point.

id

ID attribute. Warning: if you modify this variable, you can get duplicate IDs for particles.

v

Velocity of the current point.

ptnum (read-only)

Point number of the point being processed.

pstate

State of the current particle. This is an integer bit field with the following flags:

0×01

Is a “primary” particle (not birthed from an existing particle).

0×02

Will die before the next frame.

0×04

Stopped.

0×08

Has collided.

0×10

Stuck to static or moving geometry.

0×20

Is associated with a rigid body dynamic simulation.

0×40

Active.

0×80

Motion is overridden by a CHOP.

This bit-field may change in the future. See $HFS/houdini/vex/include/pop.h.

Npt (read-only)

Total number of points geometry.

age

Age of the current point (how many seconds a particle has been alive).

TimeInc (read-only)

Time increment between frames (SOP context)/Time increment for particle simulations (POP context).

N

Point normal.

Frame (read-only)

Current frame. This may not be an integer value.