flow nodes
7 node types in the flow category.
foreach#
aliases: for_each loop foreach_piece for_loop
Loop a subgraph over connected pieces, attribute values, points, prims, or N times (with optional feedback).
The body is a nested graph. Inside it, an {"type":"input","params":{"index":0}} node yields the current piece (or the previous iteration's result in feedback mode); index 1 yields the whole input; index 2 the foreach's second input. Vars the body's "=expr" params and code read by their bare name: iteration, numiterations, value (piece attribute value / element number), attr (object of the element's attributes, e.g. attr.height), plus all parent vars. feedback:true is count-based and runs all iterations in one cook at the current time; for feedback over frames use solver.
Inputs
| # | name | description |
|---|---|---|
| 0 | geo | geometry to iterate over (optional for count mode) (optional) |
| 1 | extra | available inside the body as input index 2 (optional) |
Parameters
| name | type | default | range | description |
|---|---|---|---|---|
mode | enum | "pieces" | pieces = by piece_attrib (or connectivity); count = N iterations; points/prims = one element each options: pieces count points prims | |
piece_attrib | string | "" | pieces: prim attribute to group by ("" = connectivity) | |
count | int | 4 | 0..1000000 | count mode: iterations |
feedback | bool | false | count mode: feed each result into the next iteration (output = last) | |
body | graph | {nodes, output} | subgraph {nodes, output} run per iteration | |
max_iterations | int | 10000 | 1..1000000 | safety limit |
Example
{
"type": "foreach",
"in": ["pieces"],
"params": {
"mode": "pieces",
"body": {
"nodes": {
"piece": { "type": "input", "params": { "index": 0 } },
"lift": {
"type": "transform",
"in": ["piece"],
"params": { "translate": [0, "=iteration * 0.2", 0] }
}
},
"output": "lift"
}
}
}
Used in the examples guided_town, market_street, rail_along_curve, scifi_panel, town_from_lots.
graph_ref#
aliases: object_merge reference ref
Use the output (or any node) of another graph in the package — compose scenes from separate graphs.
Inputs
None (generator).
Parameters
| name | type | default | range | description |
|---|---|---|---|---|
graph | string | "" | package graph name | |
node | string | "" | node in that graph ("" = its output) | |
vars | json | {} | override that graph's vars |
Example
{
"type": "graph_ref",
"params": { "graph": "island", "node": "ground", "vars": { "seed": 7 } }
}
input#
aliases: subnet_input loop_input
Inside a subgraph (foreach/solver body or asset): receives the parent input with this index.
Inputs
None (generator).
Parameters
| name | type | default | range | description |
|---|---|---|---|---|
index | int | 0 | 0.. | foreach: 0 = current piece/feedback, 1 = whole input, 2 = foreach second input. solver: 0 = previous frame, 1 = initial, 2/3 = extra inputs. assets: input number |
label | string | "" | documentation label for asset inputs |
Example
{
"nodes": {
"box": { "type": "box", "params": { "divisions": [2, 2, 2] } },
"each": {
"type": "foreach",
"in": ["box"],
"params": {
"mode": "prims",
"body": {
"nodes": {
"face": { "type": "input", "params": { "index": 0 } },
"x": {
"type": "poly_extrude",
"in": ["face"],
"params": { "distance": "=0.05 + iteration * 0.02" }
}
},
"output": "x"
}
}
}
},
"output": "each"
}
Used in the examples growth, guided_town, market_street, rail_along_curve, scifi_panel, town_from_lots.
merge#
aliases: combine join
Combine any number of inputs into one geometry (attributes, groups and material tables are unioned).
Material tables are unioned and images (texture nodes) combined. What several inputs share (the same image, the same material) is kept once. A name two inputs use for different things is made distinct, so each piece keeps its own maps and material: package outputs or asset instances whose maps are all called "basecolor" get theirs renamed "<material>_basecolor" (else "basecolor_2" …), different materials of one name "<name>_2", and the input's material table and prim "material" follow. Two different images under one name inside one input are warned about, as texture nodes and materials then cannot tell them apart.
Inputs
| # | name | description |
|---|---|---|
| 0 | inputs | any number of geometries (any number) |
Parameters
None.
Example
{
"nodes": {
"box": { "type": "box" },
"ball": { "type": "sphere", "params": { "center": [2, 0, 0] } },
"both": { "type": "merge", "in": ["box", "ball"] }
},
"output": "both"
}
Used in the examples asset_cleanup, blob_creature, cloth_drape, corridor_panels, eroded_valley, forest_on_terrain, fracture_settle, guided_town, image_cutouts, lsystem_tree, machined_bracket, market_street, material_set, rail_along_curve, rusty_drum, scifi_panel, sparks, stair_flight, terrain_tiles, town_from_lots, unreal_landscape, weathered_cabinet, worn_machine.
null#
aliases: output out passthrough
Pass-through. Use as a named output/marker (e.g. "OUT").
Inputs
| # | name | description |
|---|---|---|
| 0 | geo | geometry (optional) |
Parameters
None.
Example
{
"nodes": {
"box": { "type": "box" },
"OUT": { "type": "null", "in": ["box"] }
},
"output": "OUT"
}
Used in the examples cloth_drape, fracture_settle, growth, sparks.
solver#
aliases: sop_solver sopsolver
Feedback over frames (Houdini SOP Solver): run a body graph once per frame on the previous frame's result, for growth, accumulation and settling.
Cooking at frame N runs the body for every frame from start_frame to N (once per substep). Inside the body, {"type":"input","params":{"index":0}} is the previous frame's result (the initial geometry on start_frame), index 1 the initial geometry, 2 and 3 the extra inputs cooked at that frame. Before start_frame the initial geometry passes through. The body sees the vars iteration (frames since start_frame, from 0), substep, frame, time and timeInc (the step's time; frames are fractional between substeps), plus parent vars, by their bare name; wrangles also get @Frame @Time @TimeInc. Caching: the state after frame f has the signature S(f) = hash(S(f-1), f, extra-input signatures at f), starting from S(start_frame-1) = hash(params, vars, initial input at start_frame). Every frame's state is cached under S(f), so cooking frame 11 after frame 10 runs the body once, and going back to an earlier frame is a cache hit. foreach with feedback:true is different: it is count-based (N iterations in one cook, no notion of time) and is cached as a whole.
Inputs
| # | name | description |
|---|---|---|
| 0 | initial | geometry the solve starts from (cooked at start_frame) |
| 1 | extra1 | available in the body as input 2, cooked at each simulated frame (optional) |
| 2 | extra2 | available in the body as input 3, cooked at each simulated frame (optional) |
Parameters
| name | type | default | range | description |
|---|---|---|---|---|
body | graph | {nodes, output} | subgraph {nodes, output} run per frame (and substep): input 0 = previous frame, 1 = initial, 2/3 = extra inputs (default: pass through) | |
start_frame | int | 1 | first frame the body runs on; earlier frames output the initial geometry | |
substeps | int | 1 | 1..1000 | body runs per frame; timeInc = 1 / (fps * substeps) |
max_frames | int | 1000 | 1..1000000 | safety limit: most frames simulated from start_frame |
Example
{
"type": "solver",
"in": ["seed"],
"params": {
"body": {
"nodes": {
"prev": { "type": "input", "params": { "index": 0 } },
"grow": {
"type": "poly_extrude",
"in": ["prev"],
"params": { "group": "@N.y>0.9", "distance": 0.1 }
}
},
"output": "grow"
}
}
}
Used in the example growth.
switch#
Pass through one of several inputs by index (use "=expr" to drive it from vars).
Inputs
| # | name | description |
|---|---|---|
| 0 | inputs | candidate geometries (any number) |
Parameters
| name | type | default | range | description |
|---|---|---|---|---|
index | int | 0 | which input to output (clamped) aliases: input |
Example
{
"vars": { "variant": 1 },
"nodes": {
"box": { "type": "box" },
"ball": { "type": "sphere" },
"pick": {
"type": "switch",
"in": ["box", "ball"],
"params": { "index": "=variant" }
}
},
"output": "pick"
}
Used in the examples asset_cleanup, lsystem_tree, machined_bracket, market_street, rail_along_curve, scifi_panel, unreal_landscape.