Externalize Operator
Agent Buildingexternalize-operatorExternalize Operator is an Agent Skill for agent building published in the dylanroscover/Embody repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
MUST READ before calling externalize_op or save_externalization. Required workflow steps.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/dylanroscover/Embody/blob/HEAD/.claude/skills/externalize-operator/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/externalize-operator, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Externalize Operator Workflow
Tagging (includes save)
externalize_op tags the operator AND writes it to disk in one step (it calls Update() internally). No separate save is needed.
- Tag and externalize:
externalize_opon the operator (auto-detects type if omitted) - Verify:
get_externalization_statusto confirm dirty state and file path - Inspect: Verify file exists in
embody/via file inspection
Re-exporting After Changes
save_externalization force re-exports an already-externalized operator. Use it after modifying an operator in TD when you need to update its file on disk.
Creating Python Files for TouchDesigner
When creating Python files (scripts, extensions, test files, callbacks):
- Create the textDAT in TouchDesigner first (via MCP
create_opor in TD UI) - Write the Python code into the DAT (via MCP
set_dat_content) - Tag the DAT for externalization (
externalize_op) — Embody writes the.pyfile to disk
NEVER manually set the file and syncfile parameters — Embody handles all file path management.
Exporting a Portable Tox
Export any COMP as a self-contained .tox with all Embody metadata stripped:
- Via MCP:
execute_pythonwithop.Embody.ExportPortableTox(target=op('/path/to/comp'), save_path='/output/path.tox') - Via UI: Manager UI > Actions popup > "Export portable tox"
The exported .tox works in any TD project with no missing file errors.
Checking Status
get_externalizations— list all externalized operators with statusget_externalization_status— get dirty state, build number, timestamp, file path for a specific operator
TDN Export — Palette COMP Handling
When exporting a TDN-strategy COMP whose network contains TD palette components (e.g. abletonLink, Widget components, anything under Samples/Palette/), Embody consults the Tdnpalettehandling par on the Embody COMP's TDN page:
- Ask (default): On first encounter of each palette COMP, a four-button dialog appears — Black Box (this COMP), Full Export (this COMP), Black Box for All, Full Export for All. The per-COMP choice is stored via
comp.store('_tdn_palette_handling', ...)so repeated exports don't re-prompt. - Black Box: reference the palette only, emit
"palette_clone": true, skip internal children. Correct for stock palette COMPs. - Full Export: export all children as if the COMP were a regular user COMP. Use only when palette internals have been heavily customized.
Check and override programmatically: op.Embody.par.Tdnpalettehandling = 'blackbox' | 'fullexport' | 'ask', or force a specific COMP: op('/path/to/comp').store('_tdn_palette_handling', 'fullexport').