<aside>

$$ \Large\textbf{Attributes are how Houdini gives meaning to geometry.} $$

</aside>

TL;DR — VEX Data Types

Attributes

Learn about attributes: 1. Oversimplified Attributes — The Data 🟢

Data Type VEX Attribute Syntax What it stores Example Common Use
Integer — int i@name A whole number i@id = 1; IDs, counts, flags
Float — float f@name A floating-point number f@weight = 1.5; Weights, scale, values
Vector — vector v@name Three components: {x, y, z} v@dir = set(1, 0, 0); Positions, directions, colors
Vector4 — vector4 No dedicated standard vector4 attribute binding equivalent to v@ Four components: {x, y, z, w} vector4 value = {0, 0, 0, 1}; Four-component data
Quaternion — vector4 representation p@name A rotation represented by four components p@orient = quaternion(radians(45), {0, 1, 0}); Orientations, rotations
Matrix3 — matrix3 3@name A 3×3 matrix 3@transform = ident(); Rotation and linear transforms
Matrix — matrix 4@name A 4×4 matrix 4@transform = ident(); Full transforms, including translation
String — string s@name Text s@name = "Hello"; Names, paths, tags
Integer array — int[] i[]@name Multiple integers i[]@ids = array(1, 2, 3); Lists of IDs
Float array — float[] f[]@name Multiple floats f[]@values = array(1.0, 2.0, 3.0); Weights, samples, values
Vector array — vector[] v[]@name Multiple vectors v[]@positions = array(set(0,0,0), set(1,0,0)); Positions, directions
String array — string[] s[]@name Multiple strings s[]@tags = array("apple", "banana", "orange"); Paths, tags, identifiers

Every attribute can be described by two fundamental things:

<aside>

$$ \Large\textbf{Type} \;\rightarrow\; \textbf{What kind of data is it?} $$

</aside>

attribute_general_gerardojustel_re1mon_red.mp4

<aside>

$$ \Large\textbf{Class} \;\rightarrow\; \textbf{What geometry element does the data belong to?} $$

</aside>

But what is an attribute?

An attribute is data attached to geometry.

Attributes aren't necessarily visible geometry. They're information about the geometry.

@Cd       → color
@pscale   → size
@v        → velocity
@N        → direction
@id       → identity
@orient   → rotation

Why should I care?

Attributes are how you store information and use that information to control what Houdini does.

A point isn't just a point. With attributes, it can become:

**A particle moving at 5 m/s, rotated 30°, colored red, scaled to 0.2, and carrying ID 1847.**

$$ \textbf{Create data} \;\rightarrow\; \textbf{Store it as attributes} \;\rightarrow\; \textbf{Use that data to drive behavior.} $$

<aside>

$$ \Large\textbf{Attribute Types} $$

</aside>

Integer — int

Whole numbers:

$$ 1,\ 2, \ 3 $$

Float — float

Decimal numbers:

$$ 0.5,\ 3.14 $$

Vector — vector

Three floats:

$$ \{x, y, z\} $$

Vector4 — vector4

Four floats.

Commonly used for quaternions.

$$ \{x, y, z, w\} $$

Matrix3 — matrix3

A 3×3 matrix.

Commonly used for rotations and transforms.

$$ \begin{bmatrix}a & b & c \\d & e & f \\g & h & i\end{bmatrix} $$

Matrix — matrix

A 4×4 matrix.

Commonly used for full transforms.

$$ \begin{bmatrix}a & b & c & d \\e & f & g & h \\i & j & k & l \\m & n & o & p\end{bmatrix} $$

String — string

Text data.

$$ Hello $$

Arrays — f[] i[] v[]

Arrays allow an attribute to contain multiple values.

Integer, Float, Vector arrays

$$ \{x_1, x_2, x_3, \ldots, x_n\} $$

String arrays — s[]

Useful for storing multiple pieces of text such as paths, tags, or other identifiers.

$$ \{\text{"apple"},\ \text{"banana"},\ \text{"orange"}\} $$

<aside>

</aside>

What geometry element does the data belong to?

geo.png