Principle:8beeeaaat Touchdesigner mcp Node Creation
| Knowledge Sources | |
|---|---|
| Domains | Node_Graph, CRUD |
| Last Updated | 2026-10-28 22:13 GMT |
Overview
A discipline for creating new operator nodes in a live node graph by specifying a parent COMP, an operator type, and an optional name, with initial parameter binding and automatic non-overlapping placement.
Description
Creating a node in a real-time node graph involves more than instantiation. The new operator must be placed in the parent COMP's network editor view, and its initial parameters may need to be set before it is useful. This principle addresses:
- Parent resolution: the parent COMP must exist and be valid before a child can be created. The parent's `create(node_type, node_name)` method is the TouchDesigner API entry point.
- Initial parameter binding: optional parameter overrides may be supplied at creation time. When a parameter name matches an existing `par`, its `.val` is set; otherwise, scalar attributes are set via `setattr`. Parameter application failures are logged but do not fail node creation.
- Placement delegation: after creation and parameter binding, the node's position in the network editor is determined by the Principle:8beeeaaat_Touchdesigner_mcp_Non_Overlapping_Grid_Layout principle. Explicit `nodeX`/`nodeY` in the parameters opt out of auto-layout.
- Failure semantics: if `create` returns None or an invalid node, creation fails with an error. Parameter application failures are non-fatal — the node is still created, but the caller is warned.
= Usage
Use this principle when:
- Creating a new node in a TouchDesigner network with automatic placement.
- Creating a node with initial parameters (e.g. a `textTOP` with `text="Hello"`).
- Creating a node at an explicit position (supply `nodeX`/`nodeY` to skip auto-layout).
Theoretical Basis
# Abstract algorithm description (NOT real implementation)
parent = resolve(parent_path) # td.op(parent_path); validate
if parent is None:
return error("parent not found")
new_node = parent.create(node_type, node_name)
if new_node is None or not new_node.valid:
return error("create failed")
# Apply initial parameters (non-fatal on failure)
for name, value in (parameters or {}).items():
if has_par(new_node, name):
new_node.par[name].val = value
elif is_scalar_attr(new_node, name):
setattr(new_node, name, value)
# Delegate placement (or skip if explicit nodeX/nodeY)
align_new_node(parent, new_node, parameters)
return summary(new_node)
The key invariant: parameter application and layout are non-fatal. A node is created even if a parameter fails to set — the caller gets a success result with the node summary, not an error.