Skip to content

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

PortTypeDirectionDescription
inpointsinputPoints or shape to read attributes from (shape vertices are treated as points)
scalarFieldscalarFieldoutputField that samples the nearest element's attribute value at any position

Parameters

ParamTypeDefaultDescription
attributestringselectionName of the per-element scalar attribute to read

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).

Missing or non-scalar attributes resolve to 0.0 at every position.

Coordinate space: Positions and sample coordinates are in origin-centered comp-pixel coordinates, matching the convention of all other field consumers.

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 and Vec4 attributes are not yet supported as field outputs — only scalar attributes produce a ScalarField. Use ImageSample if you need vec/color fields from spatial data
  • The output is always a ScalarField (not VectorField or ColorField) in v1
  • 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