|
| 1 | + |
| 2 | + |
| 3 | +by [Tony Lyons](https://github.com/CreativeLyons) | www.compositingmentor.com |
| 4 | +# Precomp Switcher |
| 5 | + |
| 6 | +The Precomp Switcher lets you define important settings of your Write node quickly and intuitively, and creates a **Write + Switch + Backdrop** setup. |
| 7 | + |
| 8 | +There are clear labels and colors, always letting you know the current **"State"** of the precomp. |
| 9 | + |
| 10 | +Toggle between **Precomped** and **Bypass** states, simply by disabling the switch node. The **Rendering** state reminds you to swap out your precomp when it's done rendering. |
| 11 | + |
| 12 | +Stop manually reconnecting. Start Switching. |
| 13 | + |
| 14 | +## Why use it? |
| 15 | + |
| 16 | +- **Consistency.** Every precomp in every script looks and behaves the same. |
| 17 | +- **Readability.** Tile color and label tell you at a glance whether a precomp is live, mid-render, or rendered. |
| 18 | +- **Speed.** One hotkey to build, one to render, one to read back and flip/toggle. |
| 19 | +- **Pipeline-friendly.** If your studio has its own render command, custom Write Node, custom Read Node or read-from-write tool, a TD can configure this tool to use those hooks to their own pipeline commands, instead of native Nuke ones. |
| 20 | + |
| 21 | +## The 3 states at a glance |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +Every precomp sits in one of three states. The Backdrop and Switch tile & colors all track the state together: |
| 26 | + |
| 27 | +| State | Color | What it means | |
| 28 | +|---------------|-------|-------------------------------------------------------| |
| 29 | +| **Bypass** | White | Live. Switch disabled; downstream sees the live tree. | |
| 30 | +| **Rendering** | Blue | The Write is being rendered. Visual-only marker. | |
| 31 | +| **Precomped** | Red | Reading the rendered output by the enabled Switch. | |
| 32 | + |
| 33 | +## Quick Start |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +1. Start with a saved `.nk` script. |
| 38 | +2. Head to the area of the comp tree you want to precomp and press **Shift+W**. |
| 39 | +3. Type a precomp name, click **OK**. |
| 40 | +4. You should see a new Precomp Switcher backdrop with a Write + Switch. |
| 41 | +5. With the precomp Write selected, press **F7** to render. Your Precomp Switcher should turn Blue and say **Rendering**. |
| 42 | +6. When the render is done, select only the precomp Write and press **Alt+R** to create and connect a Read. |
| 43 | +7. The Precomp Switcher should turn Red and say **Precomped**. |
| 44 | +8. Disable/enable the SwitchPrecomp at any time to toggle between Precomped and Bypass. Pressing **Alt+R** with either the Read or the Switch selected will also toggle the Bypass/Precomped states. |
| 45 | + |
| 46 | +For the full walkthrough, see User Guide §4. |
| 47 | + |
| 48 | +## Node Graph Hotkeys |
| 49 | + |
| 50 | +| Key | Action | |
| 51 | +|-------------|--------------------------------------------------------------| |
| 52 | +| **Shift+W** | Create Precomp Switcher. | |
| 53 | +| **F7** | Render selected Writes; each backdrop flips to **Rendering**. | |
| 54 | +| **Alt+R** | Read from Write, or toggle between **Bypass** and **Precomped**. | |
| 55 | + |
| 56 | +Defaults can be overridden in [`precomp_config.py`](precomp_switcher/precomp_config.py). See User Guide §7 for the full hotkey behavior, including the optional Linked Read variant. |
| 57 | + |
| 58 | +## Localization (Optional Feature) |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +If you're working with files over a network, there's an optional feature for Localizing your Precomp Reads automatically. If enabled, there will be a prompt on your first Read from Write, where it will ask if you'd like to Localize your precomp. Click **Remember my Choice** to always repeat for later Read from Write actions. The choice is stored in the Write node under a Precomp Tab, so that you can always change later. |
| 63 | + |
| 64 | +This feature is disabled by default. |
| 65 | + |
| 66 | +Set `PRECOMP_LOCALIZATION_FEATURES_ENABLED = True` in the `precomp_config.py` to enable. |
| 67 | + |
| 68 | +## Installation |
| 69 | + |
| 70 | +**Requirements:** Nuke 13+. |
| 71 | + |
| 72 | +Precomp Switcher is a self-loading plugin. Meaning it's designed to load everything it needs by just adding the folder to Nuke's plugin path. |
| 73 | + |
| 74 | +Here is a step by step guide: |
| 75 | + |
| 76 | +1. Simply download the latest Release `.zip`, or clone/download this repo anywhere on disk. |
| 77 | +2. Add the `precomp_switcher` folder (the one with all the .py files) to your Nuke plugin path. |
| 78 | + |
| 79 | + **Option A** |
| 80 | + - Drop the folder inside your `~/.nuke/` directory |
| 81 | + - Open or create your `~/.nuke/init.py` file in a Text Editor |
| 82 | + - Then add this line to your `init.py`: |
| 83 | + ```python |
| 84 | + nuke.pluginAddPath('./precomp_switcher') |
| 85 | + ``` |
| 86 | + **Option B** |
| 87 | + - Or use any other location on disk or over the network: |
| 88 | + ```python |
| 89 | + nuke.pluginAddPath('/path/to/precomp_switcher') |
| 90 | + ``` |
| 91 | + - Above is just an example path, so be sure to replace `/path/to/` with the folder path where you placed the precomp_switcher. |
| 92 | + |
| 93 | +That's it! No `menu.py` entry needed. |
| 94 | +If you want to remove, add, or change hotkeys of Precomp Switcher, open up the `precomp_config.py` in a Text Editor and there you can assign, change, or disable hotkeys. |
| 95 | + |
| 96 | +See **Developer Guide §2** for more info on customization via the config file. |
| 97 | + |
| 98 | +After Nuke launches, you should see **Edit → Node → Precomp Switcher → Create Precomp Switcher** with **Shift+W** as its hotkey. |
| 99 | + |
| 100 | +## Documentation |
| 101 | + |
| 102 | +- **User Guide (PDF)**: install, quick start, every feature, troubleshooting. |
| 103 | +- **Developer Guide (PDF)**: pipeline integration, configuration reference, architecture. |
| 104 | +- [**`precomp_config.py`**](precomp_switcher/precomp_config.py): every user setting in one file with inline comments for help. |
| 105 | + |
| 106 | +## License & Credits |
| 107 | + |
| 108 | +MIT License. © 2026 [Tony Lyons](https://github.com/CreativeLyons). See [LICENSE](LICENSE). |
| 109 | + |
| 110 | +www.CompositingMentor.com |
| 111 | +Contact: [creativelyons@gmail.com](mailto:creativelyons@gmail.com) |
| 112 | + |
| 113 | +### Special Thanks |
| 114 | + |
| 115 | +A very special thanks to **Alexey Kuchinski** for inspiring the idea, design, and functionality of the Precomp Switcher from his own tool. Full credit for the inception of the idea goes to Alexey. This is my best implementation of that idea, brought to the community. |
| 116 | + |
| 117 | +The User and Dev guides were inspired by three well-loved Nuke tool user guides: **KnobScripter v3.2** (Adrian Pueyo), **Stamps v1.1** (Adrian Pueyo & Alexey Kuchinski), and **W_hotbox v2.0** (Wouter Gilsing). Thanks for showing me how it's done! |
0 commit comments