Scaffold a recipe from an existing TD network
scaffold_recipe_from_networkSerialize a TouchDesigner component's child network into a RecipeSchema JSON, including nodes, non-default parameters, and connections. Validates and optionally writes to a vault-relative path.
Instructions
Inverse of apply_recipe: walk a COMP's child network in TouchDesigner and serialize it back to a draft RecipeSchema JSON (nodes + non-default parameters + connections + cross-references). Validates against RecipeSchema before returning. When write_path is set, writes pretty JSON to that vault-relative path; otherwise returns the recipe in structuredContent. Read-only with respect to TD — no operators are created or modified.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Recipe id/slug. Also the default filename stem when write_path is set. | |
| root_path | No | COMP whose direct children are serialized into the recipe. | /project1 |
| name | No | Human-friendly title (defaults to the id). | |
| description | No | RecipeSchema description (defaults to empty). | |
| tags | No | RecipeSchema tags. | |
| difficulty | No | RecipeSchema difficulty. | intermediate |
| include_defaults | No | When true, keep every CONSTANT-mode parameter (verbose; useful for round-trip debugging). | |
| detect_cross_refs | No | When true, rewrite str params whose value matches a sibling node's name to the bare sibling name (the apply_recipe convention). | |
| write_path | No | Optional vault-relative path to write the recipe JSON to (e.g. Recipes/myrec.json). When null, the JSON is returned in structuredContent only. | |
| overwrite | No | Refuse to clobber an existing file unless true. |