File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -195,20 +195,32 @@ By default the generated code lets `nodebpy` lay the tree out automatically when
195195Pass ` snapshot_positions=True ` to instead capture each node's authored ` location ` and restore it, so the rebuilt tree matches the original layout.
196196The tree is built with ` arrange=None ` (auto-layout off) and a ` tree.node_positions = {...} ` mapping is appended:
197197
198+ ::: {.panel-tabset}
199+ ## Hand-written
200+
198201``` {python}
199- with TreeBuilder("Wave Deform", arrange=None ) as tree:
202+ with TreeBuilder("Wave Deform") as tree:
200203 geo = tree.inputs.geometry("Geometry")
201204 out = tree.outputs.geometry("Geometry")
202205 geo >> g.SetPosition(offset=g.CombineXYZ(z=g.Position().o.position.x)) >> out
206+ ```
203207
208+ ## Generated code
209+ ```` {python}
204210code = tree.to_python(snapshot_positions=True)
205- ```
211+ ````
206212
207213``` {python}
208214#| echo: false
209215#| output: asis
210216print(f"```python\n{code}\n```")
211217```
218+ :::
219+
220+ ``` {python}
221+ #| echo: false
222+ tree
223+ ```
212224
213225Positions are applied by name, so a node a rebuild does not recreate (a reroute) or renames is skipped rather than erroring.
214226Positions inside nested groups are preserved too.
You can’t perform that action at this time.
0 commit comments