Create Python DAT
create_python_scriptCreate a TouchDesigner DAT node preloaded with your Python code, choosing between text, execute, or script types. Stores code as a node for later execution.
Instructions
Create one DAT under parent_path preloaded with your Python code. dat_type chooses a Text DAT (plain code), an Execute DAT (event hooks like onFrameStart), or a Script DAT (table builder); for a Script DAT the code is written to its auto-created companion callbacks DAT, since the Script DAT's own text is read-only. Returns the created DAT's path. This only stores code as a node; use execute_python_script instead to run Python immediately against the live project.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"parent_path": "<parent_path>",
"code": "<code>"
},
"name": "create_python_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python source to place in the DAT. | |
| name | No | Name for the new DAT; auto-generated when omitted. | |
| dat_type | No | Kind of DAT: 'text' (plain), 'execute' (event hooks), or 'script' (table builder). | text |
| parent_path | Yes | Parent COMP to create the DAT inside. |