td_snapshot
Save a component's current parameters, wiring, and DAT code to a file. Take before/after snapshots to diff changes or restore the earlier state.
Instructions
Save a component to a file so it can be diffed later.
This is how to keep "every parameter of this branch" before changing it,
instead of dumping them to text by hand. path is the COMP holding the
branch. Take one snapshot before a round of edits and another of the same
path after, under a different label, then pass both files to
td_project_diff. It lists each parameter that moved as name: before -> after, including expressions and custom parameters, and it lists wiring
and DAT code too. That is three calls. Snapshots go to
~/.td-atlas/snapshots, and a label used again replaces its file, so
reusing a label loses the state you meant to compare against.
The before snapshot is also the roll-back point. td_project_text on it gives each parameter in the form td_set_params takes, with {"expr": ...} where the diff shows only the expression's text. The diff does not mark which values are expressions, so put values back from the text, not from the diff. Paths in the file start at the COMP's own name, so a snapshot of /project1/branch holds /branch/blur1, which is /project1/branch/blur1 live. td_undo is shorter while the edits are still on the undo stack.
A component is written rather than the whole session because saving the session is a Save As: it repoints TouchDesigner at the snapshot file and leaves the artist working in ~/.td-atlas instead of their own project.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | /project1 | |
| label | No | snapshot |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |