# Switch

> Pass one of its inputs through (which).

| Node | Switch |
|---|---|
| Menu | Merge › Switch |
| **Names in each format** | |
| .oink comp (JSON) | `"type": "OC_N_switch"` |
| .nk script | `Switch` ([how .nk import works](/docs/nuke-users/nk-import)) |
| Python | `nuke.createNode("Switch")` |
| Assistant (MCP) | `create_node(type="Switch")` |
| Tab search | `switch` |

![Switch properties](/shots/nodes/switch@2x.webp)

## Inputs and outputs

| Port | Name | Type |
|---|---|---|
| input 0 | 0 | image |
| input 1 | 1 | image |
| output 0 | Image | image |

## Knobs

Panel tab **Switch**, in panel order.

| Knob | Label | Type | Default | Range / values | .nk knob | Description |
|---|---|---|---|---|---|---|
| `which` | which | float | `0` | 0 to 1 | `which` | Input to pass through (floored, clamped) |
| `nk_inputs` | inputs | float | `2` | 1 to 16 (integer) | `inputs` |  |

### Other knobs (Python, .nk and the assistant; not on the panel)

| Knob | Label | Type | Default | Range / values | .nk knob | Description |
|---|---|---|---|---|---|---|
| `gl_color` | Viewer Controls Color | float ×3 | `0, 0, 0` | 0 to 1 |  |  |
| `postage_stamp_frame` | Static Frame | int | `1` | -2147483648 to 2147483647 |  |  |
| `lifetimeStart` | Lifetime Start | int | `0` | -2147483648 to 2147483647 |  |  |
| `lifetimeEnd` | Lifetime End | int | `100` | -2147483648 to 2147483647 |  |  |
| `useLifetime` | Use Lifetime | boolean | `false` |  |  |  |
| `cached` | Cached | boolean | `false` |  |  |  |
| `bookmark` | Bookmark | boolean | `false` |  |  |  |
| `dope_sheet` | Dope Sheet | boolean | `false` |  |  |  |
| `clone_group` | Clone Group | string |  |  |  |  |
| `link_source` | Link Source | string |  |  |  |  |
| `link_overrides` | Link Overrides | string |  |  |  |  |
| `split_views` | Split Views | string |  |  |  |  |

## Knob names in .nk scripts

| .nk knob | Knob here |
|---|---|
| `inputs` | `nk_inputs` |

Other .nk knobs use the same name here. See [.nk import](/docs/nuke-users/nk-import).

## Examples

Open these from **Help › Examples…**, or from the **?** menu in this node's Properties panel.

- **Merge operations: multiply, screen, plus** (`examples/merge/merge_operations.oink`): Three Merges on the same A and B: multiply (darkens), screen (lightens), plus (adds light). The Switch picks which one the Viewer sees; change its "which" knob to compare.


---
Sources: opencomp_core/nodes/utility/switch.py, opencomp_electron/src/components/properties/knobSchema.ts, opencomp_core/nk/mapping.py
