Documentation / Node reference / code nodes

code/Attribute

Reads or writes an attribute of what its builder visits, or reads one from any of its inputs by index.

Attributes

Left unwired it READS the attribute of the point, voxel or object being visited. Wire its value input and it WRITES that attribute instead.

Inside geo/PointBuilder, geo/VolumeBuilder and geo/ObjectBuilder it can also read another element. Turn on the index override and wire an index, for instance code/Globals pointIndex plus one to read the next point. An input index of 1, 2 or 3 reads one of the builder's other inputs, which are read only; without the override it reads the element with the same index as the one being visited. Past the last element it reads zero.

These reads see the inputs as they came in. On input 0 that is the geometry before this builder wrote to it, so reading a neighbour never picks up a value written in the same cook. Reading P of another input gives a position in the visited geometry's own space.

To read a volume at a position rather than an element at an index, use code/VolumeSample. This node is not available inside a geo/SDFBuilder.

Parameters

Name Type What it does
name AttributeName The attribute to read or write.
geoType UInt8 FLOAT · INDEX · U32 · VECTOR2 · VECTOR3 · VECTOR4 · VECTOR2_64 · VECTOR3_64 · FLOAT64 · VECTOR2_U32 · VECTOR3_U32 · VECTOR4_U32 The attribute's type, for builders that visit points or voxels.
objectType UInt8 BASE_NODE_HANDLE · BOOL · COLOR · COLOR4 · FLOAT · FLOAT64 · MATERIAL_HANDLE · NETWORK_PANEL_SCENE_OBJECT_CONFIG · S8 · S32 · STRING · U8 · U32 · VECTOR2 · VECTOR2_64 · VECTOR2UINT · VECTOR3 · VECTOR3_64 · VECTOR3UINT · VECTOR4 The attribute's type, for builders that visit objects.
mappedBuffer Bool Keep the attribute's GPU buffer mapped, so the CPU sees the compute result without a copy.
overrideEntityIndex Bool Read another element than the one being visited, at the index below or the one wired in. Reads only: a write always goes to the element being visited.
entityIndex UInt32 The element to read when the index is overridden and nothing is wired.
inputIndex UInt8 Which input of the builder to read: 0 is the geometry being visited, 1 to 3 are the other inputs, read only, by index.

Examples

Scenes you can open in the editor that teach this node.

This page is generated from the engine, so it describes the release you can download. The same text is in the editor's Help panel next to the node itself.