Create Python DAT
create_python_scriptCreates a TouchDesigner DAT node containing Python code, with options for text, execute, or script type.
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parent_path | Yes | Parent COMP to create the DAT inside. | |
| name | No | Name for the new DAT; auto-generated when omitted. | |
| code | Yes | Python source to place in the DAT. | |
| dat_type | No | Kind of DAT: 'text' (plain), 'execute' (event hooks), or 'script' (table builder). | text |