/blender-3d:nodebpyfrom blender-3d
Builds, edits, and verifies Blender node trees (Geometry Nodes, shaders, compositor) as typed Python code using the nodebpy library. Handles porting hand-made setups to code, converting .blend trees to Python, and running headless or in live Blender sessions.
Ships in blender-3d. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
nodebpy turns node trees into ordinary Python: every Blender node is a typed class,
instantiating it inside a with ... tree(...) block adds it to that tree, >> links
nodes, and Python operators build Math / Compare / Boolean nodes. The Python is the
source of truth and the Blender tree its build product.
This file is the loop and the core idioms. Read a reference only when the task needs it:
| Reference | Read it for |
|---|---|
| references/writing-trees.md | node arguments, socket methods, operators, the group interface, rotations, layout |
| references/zones-and-items.md | repeat / simulation / for-each / closure zones, item nodes, switches |
| references/shader-compositor.md | materials, shader groups, worlds, compositor groups |
| references/existing-trees.md | editing a user's tree, to_python, live re-runs, group classes, asset libraries |
| references/verifying.md | plotting a tree, checking structure, evaluating geometry and simulations |
Write the script to a .py file, so later fixes are small edits.
Run it headless (or in the user's Blender, section 1.1):
uv add nodebpy "bpy==5.2.*" matplotlib # bpy matches the version: 520.x wants 5.2+
BLENDER_USER_EXTENSIONS=/nonexistent uv run python build_tree.py
Fix the one error it prints (section 4), then run again. nodebpy's errors say what to change: a mistyped enum lists the closest options, a link to a hidden socket names the sockets that exist, a Switch fed mismatched values names each type.
Verify the result before reporting success (references/verifying.md).
A tree that builds is not necessarily the tree you meant: >> picks sockets by
type, and an unlinked input silently uses its default. At minimum, count the nodes
and links and evaluate the geometry on an object.
BLENDER_USER_EXTENSIONS=/nonexistent stops an installed extension (e.g. Molecular
Nodes) bundling an older nodebpy from shadowing the one in the venv. Also
import nodebpy before import bpy.Cube exists) and saves nothing
unless you call bpy.ops.wm.save_as_mainfile(filepath=...).inspect.py, types.py): import bpy then
crashes with an obscure glog "InitGoogleLogging() twice" error.execute_blender_code, an
add-on) the same code works. Rebuild with clear=True so modifiers stay attached,
and re-run scripts with group classes through nodebpy.live.run_source
(references/existing-trees.md).| Need | Cheap way | Avoid |
|---|---|---|
| Find a node | nodebpy lookup search "named attribute" | guessing class names |
| A node's arguments, enum options, variants, outputs | nodebpy lookup show StoreNamedAttribute (--tree shader / compositor) | reading generated source |
| Methods on a socket type | nodebpy lookup socket Vector (no argument lists the types) | dir() dumps |
| Understand an existing tree | to_python(bpy.data.node_groups["Name"]) | walking nodes / links by hand |
| See the wiring | print(tree.to_mermaid()); tree.to_plot("t.png") when layout matters | screenshots |
| Idiomatic examples | the docs gallery (https://bradyajohnston.github.io/nodebpy/examples/, scripts in docs/examples/code/) and the tests (tests/test_usecases.py, test_operators.py) |
nodebpy is the installed package's console script (uv run nodebpy ..., or
python -m nodebpy ...), so it describes the version you have. Look up several nodes
at once, and only the ones you are unsure of.
from nodebpy import geometry as g # shader as s, compositor as c
with g.tree("Scatter Cubes", clear=True, is_modifier=True) as tree:
count = tree.inputs.integer("Count", 50, min_value=0)
scale = tree.inputs.float("Scale", 0.1, min_value=0.0)
(
g.Points(count, position=g.RandomValue.vector(min=-1))
>> g.InstanceOnPoints(instance=g.Cube(), rotation=g.RandomRotation(seed=2), scale=scale)
>> g.RealizeInstances()
>> tree.outputs.geometry("Geometry")
)
g.RandomValue).
Variants are class methods, ordered mode > domain > data type > operation:
g.Math.sine(x), g.Compare.float.less_than(a, b),
g.StoreNamedAttribute.point.vector(name="vel", value=v).None
(left alone) or ... (filled by the next >>). A tuple that mixes values and
sockets, g.Cube(size=(1, 1, height)), becomes a Combine XYZ / Combine Color.domain="FACE"); menu sockets
take the item's display name (g.ResampleCurve(mode="Count")). New nodes start with
the values a node added in the editor has.a >> b links a's output into b's most compatible input and returns b, so
chains read left to right. Target a socket with a >> b.i.offset; the interface
output goes last: ... >> tree.outputs.geometry("Geometry").node.i.<name> / node.o.<name> (snake_case; repeats become
value_001), node.o["Name"], node.o[0]. The raw bpy node is node.node.+ - * / ** % //, < <= > >= == != (Compare), &, |,
^, ~ (Boolean Math on booleans, Bit Math on integers), @ (matrices). Integer
/ is true division (a float) and % is floored modulo, as in Python; use // for
integer division. == builds a Compare node, so use is to compare node objects.if socket:, and/or and the builtins
max()/min() raise TypeError: use a.max(b), a.min(b), or a Switch
((x > 0).switch.float(a, b)), and is not None to test a socket exists.
round(f) and math.floor(f) return integer sockets.g.Position().o.position.z, pos.transform(world) (a point: translation applies),
normal.transform_direction(world) (a direction: it doesn't),
g.SelfObject().o.self_object.matrix(), vec.normalize(), f.map_range(0, 1, -1, 1).
fac.mix.float(a, b) and cond.switch.float(a, b) are the deliberate exceptions:
they sit on the factor or condition..point / .face / .edge / .corner / .spline / .instance / .layer give
.min(group), .max(group), .mean(group), .total(group), .at(index),
.evaluate() and more. idx == idx.point.min(island) marks the first vertex of
each island.g.Switch(cond, g.Cube(), g.Cone())
is a Geometry switch. Use a typed variant (g.Switch.float(...)) when the values
don't say.tree.inputs.<type>(name, default, ...),
tree.outputs.<type>(name); keep the returned socket in a variable. Expose the
values a user would tweak (a count, a seed, a size), not every literal.g.Position()
and used after a Set Position sees the moved points; capture values you need from
the original geometry first (g.CaptureAttribute). The same goes for Mesh Island and
similar context after Mesh to Points, Instance on Points or Realize Instances.g.RandomRotation(),
pos.rotate(rot), rot.rotate(by), matrices with @
(references/writing-trees.md). g.Cone() has its
origin at its base; g.Cylinder() and g.Cube() are centred.CustomGeometryGroup when it should be one group node. Frames:
with g.Frame("Label"):. Layout runs when the with block exits..props(...) sets what every node has and returns the node (or socket), so it
ends a chain: label=, color="#FFAA00", width=, hide=True (collapse),
hide_inputs=["Selection"], mute=True, warning_propagation="ERRORS",
pin_gizmo=True. muted(x) (from nodebpy import muted) links x through a
muted link, the input then using its own value
(references/writing-trees.md, section 7).| Error | Cause and fix |
|---|---|
TypeError: Math's operation has no option 'SUBSTRACT'. Did you mean 'SUBTRACT'? | A mistyped enum or menu value; use a suggested one. |
RuntimeError: 'Vector Math' has no 'Vector' output with its current settings {...}; available: ['Value'] | The socket is hidden by the node's mode; use one it lists, or another variant. |
RuntimeError: Socket 'A' ... is inactive | Linking into a socket the current data_type greys out; use the variant (g.Mix.vector(...)). |
SocketError: Can't tell which type of Switch to build: the values are GEOMETRY from ...; VECTOR from ... | A switch's values disagree; fix the values or use a typed variant. |
SocketError: No compatible output socket found ... / Cannot link any output ... | >> found no socket pair; name the socket: a.o.vector >> b.i.offset. |
SocketError: 'Offset' takes 3 components, not 2: (...) | A tuple of sockets has the wrong length for the input. |
TypeError: The truth value of a socket is decided when the tree runs ... | if/and/or/max() on a socket; see section 3. |
RuntimeError: ... is ambiguous | Two sockets share a name; use .i.value_001, an index or the identifier. |
AttributeError: 'Position' object has no attribute 'x' | A socket method on a node; go through .o.<socket> first. |
RuntimeError: Node 'X' must be created within a TreeBuilder context manager | A node class called outside with g.tree(...). |
TypeError: expected a NodeTree type, not TreeBuilder | Assign tree.tree, not tree, to mod.node_group. |
TypeError: ... already exists as GeometryNodeTree ... Use a unique _name | Two group classes share a _name across tree types. |
InvalidLinkWarning: Blender can't evaluate 1 link in ...: ... ('Count' takes a single value, not a field) | A field (Position, Index, a per-element value) reaches an input that takes one value; compute that value without the field, e.g. with an Attribute Statistic or a group input. |
DeprecationWarning: Blender deprecates the RotateEuler node | Use the replacement it names (g.RotateRotation). |
CodegenError from to_python | A node with no nodebpy class; pass strict=False or register an emitter. |
min_value/max_value where a user
could enter nonsense.clear=True (or to_python(..., in_place=True)),
so no .001 duplicates are left.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub giofornari/skills --plugin blender-3d11 skills in this plugin
/blender-coreFoundation for any Blender 5.2+ task an agent drives - running bpy via MCP (live) or headless CLI, context overrides, locale-safe node lookup, enum discovery, 5.x API changes, verification. Use first for any Blender, bpy, .blend or 3D-asset request; routes to the specialized blender-* skills./blender-lighting-lookdevLighting, cameras and look-dev in Blender 5.3 - studio 3-point and product lighting, HDRI environments, sun/sky exteriors, interiors, light linking, physically based light units, camera focal lengths/composition/DOF, cyclorama backdrops, looping turntables for asset presentation. Use when presenting assets, setting up scenes for rendering, or judging materials under consistent light./blender-pbr-materialsPhysically based materials in Blender 5.3 - metal/roughness rules, Principled BSDF inputs, color spaces (sRGB vs Non-Color), measured albedo/F0 values, texture-set auto-wiring, ORM channel packing, DirectX vs OpenGL normals, alpha modes, displacement, view transforms (AgX, Khronos PBR Neutral), engine-ready material rules. Use when creating, fixing, or exporting materials and textures./blender-rendering-workflowBuild, diagnose, and deliver Blender still, turntable, sequence, and animation renders with reproducible lighting, camera, color-management, compositor, and output settings. Use when a request concerns product visualization, cinematic shots, architectural renders, look development, render passes, denoising, compositing, or final image/video delivery./blender-simulationPhysics in Blender 5.3 - rigid bodies (density mass, shapes, bake to keys), classic cloth presets and pinning, new node-based Cloth/Hair Dynamics (XPBD, Collider, effectors), Mantaflow fluids, hair curves, GN simulation zones, headless baking. Use for destruction, drapes, flags, falling objects, liquids, smoke, hair motion./blender-skillInspect, convert, optimize, render, bake and validate 3D assets with local, headless Blender: glb/gltf, fbx, obj, stl, usd/usdz, ply, abc, .blend. Cut triangle count, cap texture resolution, bake AO/normal/roughness/diffuse/combined maps, render a thumbnail/turntable/4-view sheet, check a file against three.js/Unity/Unreal/Godot/iOS-AR/Android-AR/WebXR/3D-print/Sketchfab budgets, assemble a multi-asset scene. Use this skill whenever the user mentions a 3D model or asset file (glb, gltf, fbx, obj, stl, usd, usdz, ply, blend), a mesh, polycount/triangle count, UV, texture baking, decimation, a turntable render, an AR/game-engine import, or asks to check/optimize/convert/render something "for Unity", "for Unreal", "for the web", "for AR" -- even when they do not say "Blender". Headless only (`blender -b`); this is not a replacement for interactive modeling or the official Blender MCP add-on, and complements rather than competes with it.2 plugins ship this exact skill · first indexed Nov 12, 2026
Other plugins' skills for the same job