Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

field.constant

The same value at every element. A number makes a Float field, a vector a Vec2, Vec3 or Vec4 field. The value is a live slot: tuning or animating it writes the slot and re-cooks nothing.

Inputs

  • value (Float | Vec2 | Vec3 | Vec4). Default 0. The value every element samples. Its component count picks the field's type. Tuned or animated, it is a live slot a compiled chain reads.

Outputs

  • field: a Float, Vec2, Vec3 or Vec4 field holding value at every element.

Example

local points = g.points.grid({ countX = 4, countZ = 1, spacing = 1 })
local out = g.attribute.set({ geometry = points, name = "v", value = g.field.constant({ value = vector.create(1, 2, 3) }) })