Attribute to Field
Reads a named scalar attribute from a points or shape stream and exposes it as a ScalarField. Bridges per-element attribute data into FieldMath composition.
Category: Fields Menu path: Fields > Attribute to Field
Ports
| Port | Type | Direction | Description |
|---|---|---|---|
in | points | input | Points or shape to read attributes from (shape vertices are treated as points) |
scalarField | scalarField | output | Field that samples the nearest element's attribute value at any position |
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
attribute | string | index | Name of the per-element column to read — an attribute or an intrinsic |
How It Works
AttributeToField snapshots the positions and scalar attribute values from the upstream points or shape, then exposes them as a ScalarField. At each sample point, the field returns the attribute value of the nearest element (Voronoi-cell lookup).
Non-scalar attributes reduce to a scalar (Vec2/Vec3 → magnitude, Vec4 → Rec.709 luma), so velocity from TrackPoints reads as speed. A name that resolves to nothing gives a flat 0.0 field.
Coordinate space: Positions and sample coordinates are in origin-centered comp-pixel coordinates, matching the convention of all other field consumers.
Intrinsic Names
Any attribute-name field here also accepts an intrinsic — a property every element has by virtue of existing, computed on read and never stored. The leading @ is a reserved namespace: no attribute may be named with one, so a name starting with @ never hits the attribute map.
| Name | Value |
|---|---|
@index | Position in the list, starting at 0 |
@id | Stable PointId — survives filtering and reordering |
@x / @y | Position, in local geometry space |
@n | Total number of elements |
@indexnorm | @index / (@n - 1), normalized 0–1 |
@rand01 | Deterministic 0–1 per element, keyed on @id (stable as neighbours come and go) |
Names are case-insensitive (@Y = @y). A misspelled intrinsic (@bogus) resolves to nothing rather than falling through to an attribute lookup.
Non-scalar attributes reduce to a scalar by one rule everywhere: Vec2/Vec3 → magnitude, Vec4 → Rec.709 luma of RGB.
Because this node turns any column into a ScalarField, @y is the cheapest way to give any field consumer position awareness — DrawAscii, PointAttributes, ShapeAttributes, FieldMath and Remap all read the result without knowing anything about points.
Usage Examples
Mask a subset for field-driven deformation
Grid → PointAttributes (target: Custom, customAttribute: "selection", field: DistanceField.scalarField) → AttributeToField (attribute: "selection") → FieldMath (Multiply, b: Noise) → PointDeform.
The selection attribute is 1 near a shape and 0 elsewhere. AttributeToField converts it back into a field, FieldMath multiplies it against the deformation noise, and PointDeform only displaces points near the shape.
Visualize a per-element attribute
Grid → PointAttributes (target: Custom, customAttribute: "energy", field: Noise.scalarField) → AttributeToField (attribute: "energy") → Colorize → Output.
Writes per-point noise values into an energy attribute, then samples it back as a field for rasterization.
Tips
- Attribute names are case-sensitive and must match what the upstream producer wrote (PointAttributes Custom, or built-in keys like
scale,opacity,rotation,color) - Nearest-neighbor lookup gives Voronoi cells — one cell per element. For smooth blending, combine with FieldMath (Add a distance-weighted Gradient) or DistanceField
- Vec2/Vec3/Vec4 attributes are readable, but they reduce to a scalar (magnitude / Rec.709 luma). Use ImageSample if you need genuine vec/color fields from spatial data
- The output is always a ScalarField (not VectorField or ColorField) in v1
Related Nodes
- PointAttributes — writes named attributes that this node can read back
- ShapeAttributes — same, for shape vertices
- FieldMath — combine this field with other fields (multiply as mask, add for soft blend)
- ImageSample — related bridge for spatial raster data → field
- DistanceField — another way to author a scalarField from shape proximity