td_exec
Run Python in TouchDesigner and return printed output or the 'result' variable. Access full td namespace (ops, root, project).
Instructions
Run Python inside TouchDesigner and return its output.
The full td namespace is in scope (op, ops, root, project, ui, app,
families, operator type classes). A trailing expression, or a variable named
result, is returned. Reach for the structured tools first — this blocks
TouchDesigner's main thread while it runs.
A script that raises still returns what it printed before the error, and
result if it had been set, so a mistyped name on the last line does not
cost the measurements above it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |