通过 twozero MCP 控制运行中的 TouchDesigner 实例。
td_get_par_info。tdAttributeError 触发,停止。在继续之前对失败的节点调用 td_get_operator_info。me.parent() / scriptOp.parent()。td_create_operator、td_set_operator_pars、td_get_errors 等。td_get_hints。它返回你正在使用的 op 类型特定的模式。
Hermes Agent -> MCP (Streamable HTTP) -> twozero.tox (port 40404) -> TD Python
36 个原生工具。免费插件(无付费/许可证)。
上下文感知(知道选中的 OP、当前网络)。
运行设置脚本处理所有内容:
bash "${HERMES_HOME:-$HOME/.hermes}/skills/creative/touchdesigner-mcp/scripts/setup.sh"
~/Downloads/twozero.tox 拖入 TD 网络编辑器 → 点击 Installoutputresolution = 'custom' 并明确设置 width/height。prores(macOS 上首选)或 mjpa 作为后备。H.264/H.265/AV1 需要商业许可证。td_get_par_info——名称因 TD 版本而异。
Call td_get_par_info with op_type for each type you plan to use.
Call td_get_hints with the topic you're building.
Call td_get_focus to see where the user is and what's selected.
Call td_get_network to see what already exists.
重要:将清理和创建分成单独的 MCP 调用。
为每个节点使用 td_create_operator:
td_create_operator(type="noiseTOP", parent="/project1", name="bg", parameters={"resolutionw": 1280, "resolutionh": 720})
td_create_operator(type="levelTOP", parent="/project1", name="brightness")
td_create_operator(type="nullTOP", parent="/project1", name="out")
td_set_operator_pars(path="/project1/bg", parameters={"roughness": 0.6, "monochrome": true})
使用 td_execute_python——无原生连线工具:
op('/project1/bg').outputConnectors[0].connect(op('/project1/fx').inputConnectors[0])
td_get_errors(path="/project1", recursive=true)
td_get_perf()
td_get_operator_info(path="/project1/out", detail="full")
td_get_screenshot(path="/project1/out")
核心(最常用):
| 工具 | 功能 |
|---|---|
td_execute_python | 在 TD 中运行任意 Python。完整 API 访问。 |
td_create_operator | 带参数创建节点 + 自动定位 |
td_set_operator_pars | 安全设置参数(验证,不会崩溃) |
td_get_operator_info | 检查一个节点:连接、参数、错误 |
td_get_network | 查看路径上的网络结构 |
td_get_errors | 递归查找错误/警告 |
td_get_par_info | 获取 OP 类型的参数名 |
td_get_hints | 构建前获取模式/提示 |
视觉:
| 工具 | 功能 |
|---|---|
td_get_screenshot | 捕获一个 OP 查看器到文件 |
td_navigate_to | 跳转网络编辑器到 OP |
AudioFileIn CHOP (playmode=sequential)
→ AudioSpectrum CHOP (FFT=512, outputmenu=setmanually, outlength=256, timeslice=ON)
→ Math CHOP (gain=10)
→ CHOP to TOP (dataformat=r, layout=rowscropped)
→ GLSL TOP input 1 (spectrum texture, 256x2)
| 家族 | 颜色 | Python 类 | 后缀 |
|---|---|---|---|
| TOP | 紫色 | noiseTOP, glslTOP, levelTOP, nullTOP | TOP |
| CHOP | 绿色 | audiofileinCHOP, audiospectrumCHOP, mathCHOP | CHOP |
| SOP | 蓝色 | gridSOP, sphereSOP, transformSOP | SOP |
| DAT | 白色 | textDAT, tableDAT, scriptDAT | DAT |
| MAT | 黄色 | phongMAT, pbrMAT, glslMAT | MAT |
| COMP | 灰色 | geometryCOMP, containerCOMP, windowCOMP | COMP |
td_execute_python 可无限制访问 TD Python 环境和文件系统。
评论区