Save / load component (.tox)
manage_componentSave a COMP as a reusable .tox file or load a .tox into the project as an independent copy or live-linked instance.
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 |
|---|---|---|---|
| action | Yes | save a COMP to a .tox file, or load a .tox into the project. | |
| file_path | Yes | Absolute path to the .tox file (e.g. '/Users/me/components/widget.tox'). | |
| comp_path | No | (save) The COMP to save as a reusable .tox component. | |
| parent_path | No | (load) COMP to place the loaded component inside. | /project1 |
| linked | No | (load) Create a live-linked instance (externaltox) that re-reads the file on change, instead of an independent copy. | |
| name | No | (load, linked) Name for the linked COMP; defaults to the file name. | |
| create_folders | No | (save) Create the parent folders if they do not exist. |