Create interaction zones
create_interaction_zonesDefine rectangular zones over a camera or motion input; each zone fires when motion in that region crosses a threshold, outputting state and dwell channels for interaction.
Instructions
Define N rectangular zones over a camera / motion input; each zone fires when motion in that region crosses a threshold. Builds a stock-TOP chain — a motion-energy TOP (monochrome → previous-frame cache → difference), then per zone a cropTOP (region isolate) + analyzeTOP average + toptoCHOP, merged into one level CHOP, then a scriptCHOP that emits per zone a *_state channel (0/1 active) and a *_dwell channel (seconds continuously active). Ends on a 'zones' Null CHOP as the bind point — wire cues via bind_to_channel to op('…/interaction_zones/zones')['zone0_state']. Camera-only (no depth cam). Source is a TOP pulled via selectTOP, or a built-in synthetic animated Noise TOP when omitted (offline-safe, cooks clean on any install with no external asset). A live Threshold knob tunes sensitivity. Zones are normalized rects (x,y = top-left corner, w,h = size); the top-left image convention is mapped to TD's bottom-left uv origin. Returns a summary plus JSON with the container path, created node paths, the zones Null path, per-zone state/dwell channel names, the zone definitions, threshold, and warnings (no preview image — the output is a CHOP, not a TOP).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Name of the container COMP created under parent_path. | interaction_zones |
| zones | No | Rectangular zones (normalized 0..1) to watch. | |
| threshold | No | Motion level above which a zone counts as active. | |
| resolution | No | Analysis resolution [width, height] in pixels (cheap; motion detection is bandwidth-bound). | |
| parent_path | No | Parent COMP the interaction-zones container is created inside (default '/project1'). | /project1 |
| source_path | No | TOP to watch for motion (pulled via selectTOP). Omit for a built-in synthetic animated Noise TOP that cooks clean on any install (offline-safe, no external asset). |