build_geometry_nodes
Build a complete geometry node graph on a Blender object in one call, with atomic validation so nothing changes if any step fails.
Instructions
Build a whole geometry node graph on an object in one call.
The graph is built in a new node group and only put on the modifier if every step works; on any error nothing changes. The group always gets a Geometry input and output, wired through nodes named "Group Input" and "Group Output". Read a graph back with get_geometry_node_tree.
Args: object_name: Object to put the graph on (the modifier is created if needed). spec: { "inputs": [{"name", "type", "default"?, "min"?, "max"?}] extra group inputs, shown on the modifier. type: FLOAT, INT, BOOLEAN, VECTOR, COLOR, ROTATION, STRING, OBJECT, COLLECTION, MATERIAL, GEOMETRY. "outputs": same shape, extra group outputs. "nodes": [{"name", "type", "location"?: [x, y], "pair_with"?: zone output node name, on a zone's input node (GeometryNodeSimulationInput, GeometryNodeRepeatInput, GeometryNodeForeachGeometryElementInput), "settings"?: {"operation": "SINE"}, node options "inputs"?: {"Size X": 4, "Offset": [0, 0, 1]}}] socket values; a socket is a name, identifier (Value_001) or index; object/collection/material sockets take a name. "links": [[from_node, from_socket, to_node, to_socket]] } Example: a wavy grid {"inputs": [{"name": "Size", "type": "FLOAT", "default": 4}], "nodes": [{"name": "grid", "type": "GeometryNodeMeshGrid", "inputs": {"Vertices X": 40, "Vertices Y": 40}}, {"name": "pos", "type": "GeometryNodeInputPosition"}, {"name": "xyz", "type": "ShaderNodeSeparateXYZ"}, {"name": "sine", "type": "ShaderNodeMath", "settings": {"operation": "SINE"}}, {"name": "up", "type": "ShaderNodeCombineXYZ"}, {"name": "move", "type": "GeometryNodeSetPosition"}], "links": [["Group Input", "Size", "grid", "Size X"], ["Group Input", "Size", "grid", "Size Y"], ["pos", 0, "xyz", 0], ["xyz", "X", "sine", 0], ["sine", 0, "up", "Z"], ["grid", "Mesh", "move", "Geometry"], ["up", 0, "move", "Offset"], ["move", "Geometry", "Group Output", "Geometry"]]} modifier_name: Geometry nodes modifier to use or create.
Returns: Dict with the modifier, the node group, and the node and link counts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | Yes | ||
| object_name | Yes | ||
| modifier_name | No | GeometryNodes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||