td_exec_python
Run Python code in TouchDesigner to control operators, evaluate parameters, and retrieve results. Supports optional timeout and hints for debugging.
Instructions
Execute Python code inside TouchDesigner.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python code to execute in TouchDesigner's Python environment. Has access to: op(), ops(), project, app, absTime, me, parent(), mod, ui, tdu. Set __result__ = <value> to return a value to the caller. Example: '__result__ = op("/project1/noise1").par.type.eval()' | |
| timeout_ms | No | Optional per-call execution timeout in milliseconds. When omitted, TouchDesigner uses its configured default. Bounds: 100-60000 ms. | |
| include_hints | No | If True, attach a ``hints`` block via td_get_hints. Auto-injection still fires when the code touches restricted patterns (.text=, .par.file=, imports, OS escapes). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |