> For the complete documentation index, see [llms.txt](https://stage-precision.gitbook.io/grid/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stage-precision.gitbook.io/grid/touch-designer-integration/camera-tracking/camera-chop.md).

# Camera CHOP

Configure camera selection, tracking input, output resolution, overscan, and network reception with the SPNet Camera CHOP.

The SPNet Camera CHOP receives a standard camera from Grid Studio and prepares its tracking and lens data for use in TouchDesigner.

Each node selects one camera by its ID. Its output contains one sample per channel, representing the current camera state.

The operator receives SPNet directly over the network and does not require a wired input.

### Camera page

| Parameter         | Default | Description                                                                                          |
| ----------------- | ------- | ---------------------------------------------------------------------------------------------------- |
| Camera ID         | `1`     | Selects the standard SPNet camera to receive. This must match the camera's ID in Grid Studio.        |
| Rotation Source   | `Euler` | Selects whether the camera orientation is calculated from the received Euler angles or quaternion.   |
| Timeout ms        | `1000`  | Defines how long received data remains current without another packet. Set to `0` to disable expiry. |
| Hold Last         | `On`    | Keeps the last valid camera pose and lens values when current data becomes unavailable or invalid.   |
| Create Camera Rig | Pulse   | Creates the camera rig, recreates it after deletion, or updates the existing managed rig.            |

#### Camera ID

Camera ID is an integer identifying the camera within the incoming SPNet data.

For example, if Grid Studio sends a camera with ID `3`, set Camera ID to `3`.

To receive multiple cameras, create a separate SPNet Camera CHOP for each camera and select the corresponding ID.

#### Rotation Source

Both Euler and Quaternion modes convert the received orientation into TouchDesigner XYZ rotation angles in degrees.

The generated camera rig uses these converted values automatically.

#### Timeout and Hold Last

With the default timeout of `1000`, data expires after one second without a received packet.

If Hold Last is enabled, the rig keeps its last valid pose and lens settings while the status channels indicate that current data is unavailable.

{% hint style="info" %}
Timeout does not delay incoming data. It determines when previously received data expires.
{% endhint %}

#### Create Camera Rig

A camera rig is created automatically when the operator is first added.

Use this button if you delete the rig or need to update its generated setup. The rig is created beside the CHOP with `_rig` appended to its name.

### Output page

| Parameter         | Default | Description                                                                                   |
| ----------------- | ------- | --------------------------------------------------------------------------------------------- |
| Output Width      | `1920`  | Requested final image width in pixels.                                                        |
| Output Height     | `1080`  | Requested final image height in pixels.                                                       |
| Overscan Override | `On`    | Uses the local Overscan Factor. Disable it to follow the overscan received through SPNet.     |
| Overscan Factor   | `1.1`   | Expands the internal rendering area while preserving the final output framing and dimensions. |

#### Output resolution

Set Output Width and Output Height manually. The standard SPNet camera does not include pixel resolution.

Use an aspect ratio that matches the source camera to maintain the expected perspective.

The actual output dimensions are subject to TouchDesigner's license limits and the integration's resolution limits.

#### Overscan

Lens distortion can sample image areas outside the original camera frame. Overscan renders additional scene content around that frame so the distortion stage can use it.

| Factor | Internal rendering area                |
| ------ | -------------------------------------- |
| `1`    | Original width and height.             |
| `1.1`  | 110% of the original width and height. |
| `2`    | Double the original width and height.  |

The final image is cropped back to the configured output dimensions. Increasing overscan preserves the lens calibration and final framing.

The local Overscan Factor is available while Overscan Override is enabled.

{% hint style="info" %}
Larger overscan values increase rendering cost. A factor of `2` requests four times as many internal pixels before resolution limits are applied.
{% endhint %}

### Connection page

| Parameter         | Default        | Description                                                                                                             |
| ----------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------- |
| Port              | `37373`        | UDP destination port used by the SPNet sender.                                                                          |
| Bind Address      | `0.0.0.0`      | Local address to listen on. The default listens on all local interfaces.                                                |
| Multicast Group   | `237.37.37.37` | Multicast group to join. Leave empty for a unicast-only connection.                                                     |
| Interface Address | `0.0.0.0`      | Local network adapter address used for multicast reception. The default uses the operating system's selected interface. |

For multicast, the sender and receiver must use the same group and port.

For unicast, configure the sender to target the TouchDesigner computer's IPv4 address and clear Multicast Group.

Interface Address always refers to an address on the receiving computer.

### Useful output channels

The generated rig already connects the required channels. You can also use them in your own network.

| Channels                        | Description                                                             |
| ------------------------------- | ----------------------------------------------------------------------- |
| `cam_tx`, `cam_ty`, `cam_tz`    | Camera position prepared for TouchDesigner, in meters.                  |
| `cam_rx`, `cam_ry`, `cam_rz`    | Camera rotation prepared for TouchDesigner XYZ rotation, in degrees.    |
| `cam_fov`                       | Horizontal field of view in degrees.                                    |
| `active`                        | `1` when the selected camera is present in the current, unexpired data. |
| `pose_valid`                    | `1` when the current camera pose is valid.                              |
| `lens_valid`                    | `1` when the current lens data is valid.                                |
| `held`                          | `1` when previously valid pose or lens values are being retained.       |
| `packet_age_ms`                 | Time since the shared receiver last received a packet, in milliseconds. |
| `overscan`                      | Overscan received through SPNet.                                        |
| `render_overscan`               | Applied overscan factor after the local override and internal limit.    |
| `output_width`, `output_height` | Final output dimensions after limits are applied.                       |
| `render_width`, `render_height` | Internal rendering dimensions after limits are applied.                 |

{% hint style="info" %}
For a custom Camera COMP, use the `cam_*` channels. These contain the values prepared for TouchDesigner.
{% endhint %}
