build_network
Construct an entire Houdini node network in one atomic, validated call, with optional dry-run. Creates all specs or none, returning cooked errors and geometry counts.
Instructions
Build a whole node network in ONE atomic call — the PREFERRED way to construct anything of 3+ nodes (massively faster than node-by-node calls, and either the whole network builds or nothing does).
Every node type, parameter name, and input reference is validated against the running Houdini BEFORE anything is created; errors come back with did-you-mean suggestions. Use dry_run=True to prove a plan when using unfamiliar node types. The result includes cooked evidence: per-node errors and the display node's geometry counts — read them instead of assuming success.
Each node spec dict supports exactly these keys; an unknown one (in a spec or in an input entry) is a validation error with a did-you-mean, never a silently dropped request: type (required), name, parms (lists set whole parm tuples; a value written {"expr": "ch('../x')"} is set as an expression, with an optional "language": "hscript" | "python", also as one component of a list: "t": [{"expr": "$F"}, 0, 0]; a ramp takes the whole ramp as {"keys", "values", "basis"}), expressions (or its alias exprs: a block of parm name -> expression), inputs (list of source names — earlier spec names, existing children, or absolute paths; or dicts with index or input_name / source / source_output, where input_name is a connector name or label as get_node_card lists them and source_output an output index or name ("v", "P"); or {"indirect_input": n} to wire from connector n of the parent subnet itself), flags (display/render/bypass/template), color [r,g,b], comment, override_expression, run_callbacks. Parms are written in the order given.
A string aimed at a numeric parameter is caught during validation and answered with the {"expr": ...} spelling, instead of failing mid-build and rolling the whole graph back.
A literal in parms does not replace an expression the parm already
holds (a Ray SOP ships dir = @N.x): the dry run lists such parms in
expressions_in_the_way, the build reports expressions_kept and a
warning. "override_expression": true on the spec clears them first.
Display: in a network that was empty, the last node gets the display
flag unless a spec sets one. A display flag asked of a node that has
none (a usdrender_rop) goes to its nearest input that has one, listed in
display_set_upstream.
A LOCKED parm (karmarendersettings resolutiony while res_mode is
autoheight) takes nothing; such a spec is refused at validation, nothing
built, with locked_parms naming the menu whose callback sets the lock.
Houdini runs callbacks only from the UI: "run_callbacks": true on the spec
runs each parm's callback after its write, so {"res_mode": "manual",
"resolution": [1920, 1080]} builds. Validation replays a spec on a probe,
its callbacks included, only when it writes a parm a fresh node locks.
There is no "children" key: build the subnet, then call build_network again with the subnet as parent_path.
Nodes built inside a DOP network come with simulation_cache: the
network to pass to reset_simulation before reading a frame it cooked.
Args:
parent_path: Network to build inside (e.g. "/obj/geo1"). A missing
parent directly under /obj is created, as the container the
specs' context needs (geo for SOPs, lopnet for LOPs), and
removed again if the build fails; a dry run reports it as
would_create_parent.
nodes: Ordered node specs (see above).
dry_run: Validate the whole spec without creating anything.
layout: Also lay out the parent network afterwards (default True;
honoured only when auto-layout is enabled). The nodes this call
creates are always positioned, each relative to its inputs,
regardless of this flag; nodes that already existed keep their
exact positions, so building into a hand-arranged network is safe.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodes | Yes | ||
| layout | No | ||
| dry_run | No | ||
| parent_path | Yes |