Create motion reactive
create_motion_reactiveBuild a video-analysis chain exposing reactive motion and brightness channels to bind any parameter in TouchDesigner.
Instructions
Build a video-analysis chain that exposes ready-to-bind reactive channels — overall brightness plus frame-to-frame motion energy — on a Null CHOP. The camera counterpart to extract_audio_features: bind any parameter to op('…/motion_reactive/features')['motion'] and it responds to movement in front of the camera, or ['brightness'] to ambient light. A Sensitivity knob scales both. Creates a new baseCOMP under parent_path holding the source, a downsized monochrome analysis chain, and a 'features' Null CHOP output. Source can be the live camera (may prompt for macOS permission), a movie file, an animated synthetic pattern (for testing without a camera), or an existing TOP. Optical flow is unavailable on macOS, so direction isn't exposed. Returns a summary plus a JSON block with the container path, created node paths, the features Null path, the channel names, exposed controls, any node errors, and warnings (no preview image — the output is a CHOP, not a TOP).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | No | Video source. 'camera' = live webcam/capture device (the real-world default; creating it may pop a one-time macOS camera-permission dialog — click Allow). 'file' = a movie file. 'synthetic' = an animated noise pattern, handy for testing without any device permission. 'existing_top' = analyze a TOP you already have. | camera |
| movie_file_path | No | Path to a movie file to play as the source; used only when source='file'. | |
| existing_top_path | No | Path of an existing TOP to analyze; used only when source='existing_top'. | |
| analysis_resolution | No | The video is downsized to this square resolution before analysis — small keeps it cheap (the reactive values barely change with size). | |
| expose_controls | No | When true (default), expose a live 'Sensitivity' knob (a gain over every feature channel). | |
| parent_path | No | Parent network where the motion-reactive container is created (default '/project1'). | /project1 |