Principle:8beeeaaat Touchdesigner mcp Node Introspection
| Knowledge Sources | |
|---|---|
| Domains | Node_Graph, Introspection |
| Last Updated | 2026-10-28 22:13 GMT |
Overview
A discipline for reading the live state of nodes in a real-time node graph — metadata (name, path, type, ID) and evaluated parameters — with a light-vs-full trade-off that avoids expensive parameter evaluation when only identity is needed.
Description
In a live node graph (such as TouchDesigner), each operator node carries both static identity metadata (name, path, OP type, ID) and dynamic state (evaluated parameter values). Reading evaluated parameters is expensive because each `par.eval()` may trigger a cook chain. This principle addresses two design problems:
- Light vs. full summary: when listing nodes under a parent (e.g. verifying a newly created node exists), only identity metadata is needed. Evaluating every parameter would cook the entire graph unnecessarily. A "light" summary returns empty `properties` and is the default; a "full" summary evaluates all parameters via `node.pars("*")` and `par.eval()`.
- Parameter-to-path normalization: when a parameter evaluates to another OP (a node reference), the evaluated value is converted to the OP's path string, not a raw object, so the result is JSON-serializable.
Usage
Use this principle when:
- Listing all nodes under a parent COMP to verify creation, deletion, or layout.
- Reading a single node's full parameter set for inspection or debugging.
- Building a "snapshot" of the current graph state.
Use the light summary (no properties) for bulk listing and the full summary (with properties) only when you need the actual parameter values.
Theoretical Basis
The core trade-off is evaluation cost:
# Abstract algorithm description (NOT real implementation)
def get_node_summary_light(node):
# Identity only — no parameter evaluation, no cook chain
return {"id": node.id, "name": node.name, "path": node.path,
"opType": node.OPType, "properties": {}}
def get_node_summary_full(node):
# Evaluates every parameter — may trigger cooks
props = {}
for par in node.pars("*"):
value = par.eval()
if isinstance(value, OP):
value = value.path # normalize node refs to paths
props[par.name] = value
return {"id": node.id, "name": node.name, "path": node.path,
"opType": node.OPType, "properties": props}
The light summary is O(1) in graph depth; the full summary is O(parameters) with each parameter potentially O(cook chain). The choice is exposed as an `include_properties` boolean on list operations.
Practical Guide
When reading node state:
- For verification (does this node exist? what is its type?): use the light summary.
- For debugging (what are the actual parameter values?): use the full summary.
- When evaluating fails on a single parameter, record the error string in place of the value rather than failing the entire summary.