Create blob reactive
create_blob_reactiveCreates a blob-tracking network in TouchDesigner that outputs normalized per-blob positions (x, y, size) for driving parameters from multiple objects or hands in a camera feed.
Instructions
Build a blob-position-tracking chain that drives parameters from the POSITIONS of multiple objects/hands in a camera (or a TOP) — the per-blob counterpart to create_motion_reactive's single aggregate motion value. Creates a container under parent_path with a Video Device In TOP (or a Select TOP pulling an existing TOP), a Monochrome + Threshold TOP to isolate bright blobs, a Blob Track operator assigning each blob a persistent slot, and a Script CHOP that normalizes the tracker's per-blob output into a deterministic 'blobs' Null CHOP with channels blob0_x, blob0_y, blob0_size, blob1_x, … Bind any parameter to op('…/blob_reactive/blobs')['blob0_x'] (or pass targets to bind by expression as value*scale+offset). Camera source may prompt for (and briefly hang on) a macOS camera-permission dialog. The Blob Track operator is a palette/CV op whose optype and channel naming vary by TD build — the chain is built fail-forward and warns (rather than failing) if it is unavailable, and the Script CHOP normalizes whatever channels the tracker emits. Returns a summary plus a JSON block with the container path, the blobs CHOP path, the tracked output TOP, the tracker type used, channel names, bound targets, and warnings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parent_path | No | Parent network where the blob-reactive container is created (default '/project1'). | /project1 |
| name | No | Base name for the container COMP that holds the chain. | blob_reactive |
| source | No | Blob source. 'camera' = live webcam/capture device (the real-world default; creating it may pop a one-time macOS camera-permission dialog — click Allow, and note it can briefly hang TD at the modal). 'top' = analyze an existing TOP you name in source_top. | camera |
| source_top | No | Path of an existing TOP to track blobs in; used only when source='top' (a Select TOP pulls it in so no cross-container wire is needed). | |
| camera_index | No | Which capture device to use when source='camera' (0 = the first/default camera). Maps to the Video Device In TOP's device index. | |
| threshold | No | Luma threshold [0–1] for isolating blobs: pixels brighter than this are considered part of a blob. Lower catches dim/large blobs, higher only bright ones. Drives both the Threshold TOP mask and the blob tracker's own threshold. | |
| max_blobs | No | Maximum number of blobs to track simultaneously, each given a persistent slot/ID. | |
| targets | No | Per-blob parameter bindings. Each entry binds one node parameter by expression to op('…/blobs')['blob<blob>_<axis>'] * scale + offset. Omit to just build the tracking chain and bind later. |