Save / load component (.tox)
manage_componentSave a TouchDesigner COMP to a reusable .tox file or load a .tox into the project, with optional live-linked instances that update on file changes.
Instructions
Build a reusable component library by moving COMPs to/from .tox files on disk. Two actions: 'save' writes the COMP at comp_path to file_path as a .tox (overwriting any existing file, optionally creating parent folders) and returns the saved path and byte size; 'load' reads file_path back into parent_path, either as an independent copy or a live-linked instance (via linked) that re-reads the file on change, returning the loaded node's path, type, and child names. Paths are on the machine running TouchDesigner. Marked destructive because 'save' can overwrite an existing file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | (load, linked) Name for the linked COMP; defaults to the file name. | |
| action | Yes | save a COMP to a .tox file, or load a .tox into the project. | |
| linked | No | (load) Create a live-linked instance (externaltox) that re-reads the file on change, instead of an independent copy. | |
| comp_path | No | (save) The COMP to save as a reusable .tox component. | |
| file_path | Yes | Absolute path to the .tox file (e.g. '/Users/me/components/widget.tox'). | |
| parent_path | No | (load) COMP to place the loaded component inside. | /project1 |
| create_folders | No | (save) Create the parent folders if they do not exist. |