base-node (.bn) v1.0.0-rc.8

Base Node for Blender

The language as Blender reads it: what the reference leaves to the host, for Blender's node trees. Each numbered section completes the section of the reference of the same number. The library (base_node_blender: the nodes, the checker, base-node check) and the add-on hold a text to these rules; what each destination accepts is in targets, ways of writing a graph in idioms.

Text → Tree builds a text into the trees of a .blend; Tree → Text reads a tree back as text.

1. File Structure#

A use finds its module (reference, 1):

Tree → Text writes a use and a call for a group a module built while the group reads as the module builds it now: its text against the text of the module's graph built afresh, for the same kind of tree and types, both read as any tree is. A group edited in the file since, or whose module changed or is not found, is a graph of the text, written as it is.

1.1 File Head#

The add-on reads the head of a .bn file dropped on it (reference, 1.1), with four directives of its own:

// @module waves
// @title Ripples and waves
// @author Base Node
// @license MIT
// @offer library, groups, example, modifier
// @example ripple_field
// @modifier "wave modifier"
// @mesh grid
DirectiveValue
@targetTargets of targets: a target, a version of it, a variant (blender@5.3 gltf). An alias (blender@latest) is the command line's, refused in a head
@offerWhat the file offers, separated by commas: library (install it as a module), groups (build its graphs into the file), example (an object carrying a graph that makes its own geometry), modifier (a modifier graph on an object)
@example, @modifierThe graph each uses, by its name as a string or as an identifier, when several could: @modifier "the \"lift\"" names the graph the "lift"
@meshThe mesh modifier makes when no object takes it: cube (default), plane, sphere, cylinder, grid

A value written in quotes is a string there too: a graph's name, a mesh.

Without @offer, a file offers library when it has a @module, groups always, example when a geometry graph nobody calls has a Geometry output and no Geometry input, and modifier when a geometry graph nobody calls has Geometry as its first input and first output (as Blender decides is_modifier, unless the graph's settings write it). With several such graphs and no @example or @modifier, the last one is used. An unknown @offer or @mesh value, a choice offered that no graph allows, and an @example or @modifier naming no graph of the file, or one of the wrong shape, are errors at their line and column.

The drop dialog. A .bn file dropped on Blender from a file manager (or opened by File > Import) opens a dialog with its title, author and license, and the choices its head offers: Install as Library copies it as <module>.bn into the Module Folder of the preferences (never over another text of that name unless Overwrite is ticked), so that use <module> finds it in every .blend; Import into the .blend builds its graphs as File > Import does; Instantiate the Example adds an object whose Geometry Nodes modifier is the graph that makes its own geometry; Add as Modifier puts the modifier graph on the object the file fell on, else on the selected objects, else on a new mesh (@mesh). The dialog starts on the modifier when the file fell on an object, else on the example, else on the import. A head with an error changes nothing and the status bar gives its line.

2. Identifiers and Keywords#

3. Graph Declaration#

3.0 Shader and Compositor Graphs#

A shader or compositor graph is a node group of that tree type, called from the graphs of the same kind like any other. Interface types are the tree's own: a shader tree has no Geometry, a compositor tree no Shader; zones too (simulate and foreach are Geometry Nodes', a compositor has no repeat). Implicit defaults (p: Vector = Position()) are for geometry trees only.

shader graph rust(uv: Vector) -> Shader {
  n = NoiseTexture(vector: uv, scale: 8.0)
  return PrincipledBSDF(
    base_color: ColorRamp(factor: n.factor).color,
    roughness: n.factor * 0.5 + 0.4)
}

compositor graph look(image: Color) -> Color {
  return image
    |> Glare(type: "Fog Glow").image
    |> ColorBalance("Base Lift": 0.95)
}

3.1 Types#

TypeDefaultDescription
Float0.0Scalar float
Int0Signed integer
BoolfalseBoolean
Vector(0.0, 0.0, 0.0)2D/3D/4D vector (a 2D or 4D tuple in a formula: 5)
Color(0.0, 0.0, 0.0, 1.0)RGBA color, written as its tuple: (r, g, b, a), or (r, g, b) for an alpha of 1
Rotation(0.0, 0.0, 0.0)Euler / quaternion rotation
MatrixIdentity4×4 transform matrix
String""UTF-8 string
Menu—Enum selector
Geometry—Mesh, curve, points, instances, or volume
Image—2D pixel buffer
Material—Material reference
Bundle—Composite socket container
Closure—Deferred subgraph

3.2 Parameters#

3.4 Templates#

The Python checker checks templates, and the add-on builds and reads back their groups. The Rust crates have no checker: they build no template.

A Blender node group has one type per socket: a graph that reads an attribute with a fallback is written once for a Float, again for a Vector, again for a Color. A template (reference, 3.4) is built into a node group of its own for each type it is called with, as a module's graph is built again for each kind of tree that calls it (3.0).

The type of a call is inferred from its arguments, or written:

  1. attribute_or<Vector>("rest", p) writes it: the arguments are then linked as to any group, converted when Blender converts them (an Int to a Float input).
  2. Else each argument given to an input of type T that is linked (a name, a node's output, an input of the calling graph) gives its type, and all must give the same: T is that type.
  3. Else, with no linked argument, a literal gives its own type: 2.0 a Float, 2 an Int, true a Bool, (x, y, z) a Vector, (r, g, b, a) a Color, "text" a String.
  4. Else the call is refused: no default type is chosen.

The type found must be one of the constraint; there is no conversion while inferring (a Vector linked to <T: Float | Color> is refused, not converted). An output gives no type: a call is typed by what goes in, never by where its value goes.

The group of a type is named after the template and its types, in parentheses as for a kind of tree: attribute_or (Vector), blend (Float, Color) for two type parameters. Built for another kind of tree too, it is attribute_or (Vector) (Compositor): the types first, then the kind, so a type Geometry is never taken for the kind geometry. Each group says the template and the types it was built from, as a variant says its graph and module, and is built once whoever calls it.

Tree → Text writes the use and the call, not the group: a call to attribute_or (Vector) reads back attribute_or(name, p), and the type is written (attribute_or<Vector>(…)) only when the arguments as read back do not infer it, by the rules above. A group the add-on did not build from a template stays the group it is: Molecular Nodes' Fallback Vector reads back as a graph of its own, never folded into a template.

Where: a template is a module's graph, brought by a use, as a graph built for another kind of tree is; a text calling its own template is refused ('attribute_or' is a template: a template is a module's graph, brought by a use). A text may still define a template, which is checked for each of its types and builds no group. Tree → Text can then write back every call from the group's tags alone. A template in the text itself is left for later: Tree → Text would have to write the template back from one of its groups.

Kinds of tree and targets. Types and kinds of tree combine: a call from a compositor graph builds the template for the caller's tree and for the type, and each type is checked in that tree ('attribute_or<Vector>' is a geometry graph that cannot be built in a compositor tree: no NamedAttribute in a compositor tree). A module that promises a target (@target) must have every type of its templates' constraints in it: a template that is a compositor graph, held to blender, cannot list Geometry.

Errors

CaseMessage
Nothing infers the typeattribute_or: write the type of T, as attribute_or<Float>(…); no argument gives it
Arguments disagreeattribute_or: T is Vector by 'fallback' and Color by 'other'; write the type, as attribute_or<Vector>(…)
A type out of the constraintattribute_or: T cannot be String; T is one of Float, Int, Bool, Vector, Color, Rotation, Matrix
Too many or too few typesblend takes 2 type(s) (T, U), not 1
Types given to a graph or a node'double' is not a template: it takes no type
A constraint's unknown typeunknown type 'Flot' in the constraint of T; expected: Float, Int, …
A parameter named like a type'Float' is a type: name a type parameter otherwise, such as T
A parameter twicetype parameter 'T' defined twice
A parameter named like an input'T' is a type parameter and an input or output of 'attribute_or'
A template that calls itselfrecursive call: 'attribute_or<Float>' calls itself
A setting without the typeT is Matrix: Mix has no data_type for Matrix; values: FLOAT, VECTOR, RGBA, ROTATION
One type's check failsthe error of that type, after the template and its type: attribute_or<Matrix>: …; an error of every type is written once, as it is
A text's own template'attribute_or' is a template: a template is a module's graph, brought by a use

What templates do not do. A template varies a type, not a value or a setting. T3D's easeQuad to easeQuint have one body but for the exponent (2 to 5) and a factor of 2ⁿ⁻¹: one graph with an input power: Float = 2.0 and pow(2.0, power - 1.0) makes them one today, without templates. Molecular Nodes' Sample Mix Float and Sample Mix Angle differ by a subtype (ANGLE), which is not a type either.

Against the corpus.

GroupsOne template?
Molecular Nodes' Fallback Float, … Integer, … Boolean, … Vector, … Color, … Rotation, … Matrix (7)Yes: attribute_or above. Their outputs are named after the type (Value, Output, Boolean, Color, Matrix): the template has one name. Fallback Geometry is another graph (a test of an empty geometry)
Index Mix Float, … Vector, … Color, … Rotation (4)Yes, <T: Float \| Vector \| Color \| Rotation>, the types Mix takes: Mix[T] and both EvaluateAtIndex[T]. The Color one alone clamps (clamp_result: true) and has a default (1, 1, 1): a template has one of each
Sample Mixed Vector, … Color, … RotationYes, calling index_mix(value, index), which infers its type from the template's own T
Sample Mix Float, … Vector, … AngleIn part: Float and Vector are one template, but the Vector one takes Position() by default, a field of one type, so its callers give it. Angle differs from Float by its subtype, not its type, and stays a graph of its own
T3D's easeQuad, easeCubic, easeQuart, easeQuintNo, and no need: one graph with a power input (above)

Versions. The Blender packages took templates with the specification (0.11.0 → 0.12.0), and so do the modules of the standard library that turn their graphs into templates: a minor version of each.

4. Statements#

An input node whose value no literal makes is a call that gives it in its settings, a tuple of as many numbers as it holds: Rotation[rotation_euler: (0.1, 0.0, 0.0)](), Vector[vector: (1.0, 2.0, 3.0, 4.0)]() (its vector_dimensions follow the tuple unless written), IntegerVector[vector: (1, 2, 3)]() (whole numbers). The Normal node of a shader or a compositor tree holds its vector on its output, a setting too: Normal[normal: (0.0, 0.7071, 0.7071)](), three numbers, the vector of a new node (0, 0, 1) when not written. The Value and RGB nodes, which also hold their value on their output, are named constants (size = 0.5). Tree → Text writes them so, and a Menu node by the item it picks (Menu[value: B]()), set once it is linked to the menu it feeds.

5. Expressions#

5.1 Node Names#

A node is written by its UI name in one word, as Blender's Add menu shows it in English: Principled BSDF is PrincipledBSDF, Noise Texture NoiseTexture, Set Position SetPosition. It is the only name a text is read by, and the one a tree reads back to. The name is the label the node type defines (bl_rna.name), never its translation: a text reads the same whatever the interface language.

The label becomes one word by one rule:

Two exceptions keep the name a node had before (its bl_idname without the prefix GeometryNode, FunctionNode, ShaderNode, CompositorNode, TextureNode or Node):

An unknown name is compared with the node names case, spaces and underscores aside, so noise_texture suggests NoiseTexture.

6. Calls with a Body, and Nameless Graphs#

In Blender, the calls that take a body (reference, 6) are its zones, and a nameless graph is a Closure zone, a value of type Closure.

6.1 Blender's Zones#

// Repeat zone
r = repeat(iterations, val: initial) -> {
  return (val: val * 0.5)
}

// For Each Element zone
out = foreach[FACE](geometry, p: Position()) -> {
  return (geometry: Points(position: p))
}

// Simulation zone
s = simulate(mesh: geometry) -> {
  return (mesh: SetPosition(mesh, offset: (0.0, 0.0, delta_time)))
}

// Closure zone & Bundle
shape = graph(t: Float) -> (h: Float) {
  return (h: sin(t * 6.28) * amount)
}
low = shape(t: 0.25)
b = CombineBundle(factor: 0.5, shape: shape)
CallArgumentsThe body seesThe body returns
repeat(count, state: start, …)The iteration count first, then one state at least, each namediteration, the statesThe next value of each state by name, or the value alone for a single state; a state left out goes on unchanged
simulate(state: start, …)Named statesdelta_time, the statesThe same, and skip
foreach[FACE](geometry, selection: s, item: field, …)Its domain in brackets; the geometry first, then selection and the input items, each namedindex, element, the input itemsIts items by name: the main items, then from the first geometry on, the generated geometry and its attributes

A body given to any other name is an error at the call ('Grid' takes no body: repeat, simulate and foreach do). A call of another shape is an error at the call, which says the shape (repeat expects iteration count first: repeat(10, state: start, …) -> { … }, foreach expects geometry first, then named items: foreach[FACE](geometry, item: field, …) -> { … }). repeat and simulate have no settings (repeat has no settings); the one setting of foreach is its domain, by position or named (foreach[domain: FACE]), POINT when not written. A call of repeat, simulate or foreach with no body is a call of a node of that name, which no tree has: the brace after it opens a frame.

The inputs and outputs of a Closure zone are items: they take no default value and no range (a closure item has no default value or range).

A state cannot go by the names of its zone: iteration in a repeat, delta_time and skip in a simulate; an input item of foreach cannot be index or element. Names are case-sensitive: a state Iteration is its own name, beside iteration (repeat(n, Iteration: 0) -> { return (Iteration: Iteration + iteration) }). A state named like them in Blender takes a key of its own with as, used by the body, the return and the users of the zone:

s = simulate(mesh: geometry, "Delta Time" as dt: 0.0) -> {
  return (mesh: mesh, dt: dt + delta_time)
}
t = s.dt

Targets#

A target is what one destination accepts: kinds of tree, types, zones, implicit inputs and nodes. A text fits the targets that accept everything it uses; it may promise some with // @target, and is then held to them. See targets.

TargetAccepts
blenderEvery node of Blender, by kind of tree: a geometry graph may use the Geometry Nodes, a shader graph the shader nodes, a compositor graph the compositor's. In every version of Blender this version of Base Node promises
blender@5.3The same in one version of Blender. An LTS says so in its name: blender@5.2-lts
blender gltfA variant, a word after the target or one of its versions: the shader nodes Blender's glTF exporter turns into a material
blender eevee, blender cyclesVariants, experimental: the shader nodes Blender says each render engine takes

blender@latest and blender@lts are aliases for a command line; a // @target that names one is an error. A destination other than Blender has its targets in its own library, which adds them (targets).

What the Text Does Not Carry#

The promise is that Tree → Text → Tree is exact within one version of Blender: a tree read as text and built back from that text, in the Blender that read it, holds every node, link, setting and value it held, bit for bit, but what this section lists. It holds across versions only as far as Blender does: a value the text leaves out because it is a new node's or a new socket's is the default of the Blender that builds the text, so a default that differs between two versions of Blender is out of the promise. The add-on's tests compare each tree of the third-party libraries with the tree built back, on Blender's data, and fail on any difference but these, by decision:

Versions#

Base Node for Blender has a version of its own, and needs one version of the core, the language (versioning): the Python package depends on base-node of that version, the crates on base-node of that version, and the git submodule core/ is that version. Over the core, it has three tiers of its own:

┌────────────────────────────────────────────────────────┐
│ Targets (what each destination accepts)                │
│         e.g., blender, blender@5.3 gltf, blender eevee │
└──────────────────────────┬─────────────────────────────┘
                           │
┌──────────────────────────▼─────────────────────────────┐
│ Standard Library Modules (stdlib/)                     │
│         e.g., math@1.0.0-rc.8, curves2d@1.0.0-rc.8     │
│         Manifest: stdlib/manifest.json                 │
└──────────────────────────┬─────────────────────────────┘
                           │
┌──────────────────────────▼─────────────────────────────┐
│ Packages                                               │
│         Python: base-node-blender 1.0.0rc8             │
│         Rust:   base-node-blender 1.0.0-rc.8           │
│         Blender Extension: 1.0.0-rc.8                  │
└────────────────────────────────────────────────────────┘

The parts#

PartWhereHolds
Blender librarypython/base_node_blender, without bpy; rust/ (crate base-node-blender) for the targetsThe schema of Blender's nodes, the formulas, the zones, the type checker, the graph it resolves, the targets of Blender by version and their variants, completion, the commands check, fmt --names and docs of base-node
Blender extensionaddon/, with bpyThe builder and the reader of trees, the editor
<bn-view>web/, Rust to wasmThe view of a text, on the core and the Blender library

A destination other than Blender is its own library's: its formulas, its checker, its targets, and its translators from Blender's. It adds its targets to this library's with add_targets (targets).

Targets (targets/)#

A target is what one destination accepts: one file per destination, targets/<name>.json, and no target defined from another. Its fields and the way a text is checked against it are in targets.

Standard Library (stdlib/)#

The standard library modules provide reusable computational geometry, math, and stylization functions.

[stdlib/manifest.json](../stdlib/manifest.json) holds what is the library's:

{
  "stdlib_version": "1.0.0-rc.8",
  "edition": "2026",
  "description": "Standard Library for the Base Node (.bn) language"
}

Each module says the rest in the head of its .bn (below), so that adding a module adds its file and edits no shared list. base_node_blender.manifest.manifest("stdlib") reads them into one manifest, the modules by name:

"curves2d": {
  "name": "curves2d",
  "version": "1.0.0-rc.8",
  "edition": "2026",
  "tier": "free",
  "targets": ["blender"],
  "file": "curves2d.bn",
  "dependencies": ["math"],
  "description": "2D curves, resampling, curvature analysis, and path operations"
}

tier is free or pro. A free module is in this repository under MIT OR Apache-2.0 and uses free modules only. A pro module belongs to a paid pack (// @pack smart-materials, "pack" in its entry), installed in the Module Folder of the add-on preferences; it may use free modules. Its dependencies are the modules its use lines name.

Every official .bn standard library file must include standardized metadata comments before its use imports:

// Base Node Standard Library — Module curves2d
// @module curves2d
// @version 1.0.0-rc.8
// @target blender
// @edition 2026
// @description 2D curves, resampling, curvature analysis, and path operations

use math (bump, fbm)
...

Before LTS, no deprecated alias shims are kept in stdlib/, and canonical naming (curves2d::) is enforced strictly.

What 1.0.0 promises#

PartUnder the promiseOutside it
Standard libraryThe graphs of the free modules: their names, their inputs and outputs, in order, with their defaultsThe packs: their versions and their stability are their own, not this document's
Blender library—Its interface: it may move while hosts are written against it
BlenderThe versions named below, tested at each releaseAny other version: best effort

The versions of Blender#

Promised by 1.0.0, and tested by the CI at each release:

The rule after that: the LTS versions Blender still maintains, and its latest stable version. A new version of Blender is taken on a best effort: its catalog is written again (make backend), the nodes it adds and removes are the changelog, and blender@latest moves with a minor version.

Before 1.0.0#

After 1.0.0#

Where the version is written#

The packages of Base Node for Blender take its version; the version of the core it needs is written in their dependencies, base-node==… of [python/pyproject.toml](../python/pyproject.toml) and base-node = { …, version = "=…" } of [Cargo.toml](../Cargo.toml):

ComponentPathVersion Scheme
Python package, the Blender library[python/pyproject.toml](../python/pyproject.toml)PEP 440 (1.0.0rc8)
Rust WASM crate, the Blender library[rust/Cargo.toml](../rust/Cargo.toml)SemVer (1.0.0-rc.8)
Rust WASM crate, <bn-view>[web/Cargo.toml](../web/Cargo.toml)SemVer (1.0.0-rc.8)
Blender Extension[addon/blender_manifest.toml](../addon/blender_manifest.toml)SemVer (1.0.0-rc.8)
Extension Repository Index[site/extensions/index.json](../site/extensions/index.json)SemVer (1.0.0-rc.8)

Blender's manifest, as Cargo, refuses the PEP 440 form of a pre-release.

Words#

TermMeaning
VariantA part of Blender's shader nodes that one consumer accepts: eevee, cycles, gltf
ExporterA tool that writes a text as another format. It lives with its format, not here
Standard libraryThe modules of stdlib/, at one version, the specification's
ModuleOne .bn file of the standard library, free or pro
PackThe pro modules sold together, with their showcases
ExtensionThe Blender add-on, Base Node
Promised BlenderA version of Blender the CI tests at each release