Houdini has two kinds of global you meet constantly, and mixing them up is a common source of confusion. HScript $-globals live in parameter fields; VEX @-attributes live in wrangles.
HScript global variables ($)
These resolve in parameter fields and expressions.
| Variable | Meaning |
|---|---|
$F, $FF | Current frame (integer), and the fractional frame. |
$T, $FPS | Current time in seconds, and the scene frame rate. |
$OS | Name of the current operator (node) - great in file paths. |
$HIP, $HIPNAME | Folder of the current .hip, and its file name. |
$JOB | Project root - anchor paths here to keep a project portable. |
VEX attribute globals (@)
These are the attributes you bind and edit inside wrangles.
| Attribute | Type | Meaning |
|---|---|---|
@P | vector | Point position in world space. |
@N | vector | Normal - shading and copy-to-points primary axis. |
@Cd | vector | Diffuse colour. |
@ptnum | int | Current point number. |
@numpt | int | Total number of points. |
@Time | float | Current time in seconds, inside VEX. |
@pscale | float | Uniform per-point scale for copies and points render. |
Which one do I use?
If you are typing into a parameter field, you want an HScript $-global. If you are inside a wrangle processing geometry, you want a VEX @-attribute. Note the overlap in naming: $F (HScript frame) and @Frame / @Time (VEX) refer to the same clock from different worlds. See the HScript cheatsheet for expressions that use the $-globals, and the snippets for wrangles that read the @-attributes, such as rand(@ptnum).
Frequently asked questions
What is the difference between $F and @Time?
$F is the HScript frame number used in parameter fields; @Time is the current time in seconds available inside VEX wrangles. Both describe the playhead from different contexts.
Is @ptnum available in every wrangle?
@ptnum is the current point number when a wrangle runs over points. In other run-over modes you get the matching index, such as the primitive or vertex number.