The Cache Directory
Both the automatic caching and the DiskCache node use the same cache directory defined using the Preferences dialog. In the Preferences, you can also set the maximum size you allow the disk cache to consume. For more information on the caching preferences, see Defining the Settings for Caching below.
Note that the cached images have unique names reflecting their point of output location in the script. This means that you can cache images from multiple nodes in the script without overwriting previously cached images.
Defining the Settings for Caching
You can define the settings for caching in the Preferences > Performance > Caching.
1. | Select Edit > Preferences (or press Shift+S). |
The Preferences dialog displays.
2. | Under Caching > Disk Caching, specify where you want Nuke to cache out data to disk. Pick a local disk (for example, c:/temp), preferably with the fastest access time available. |
The environment variable NUKE_DISK_CACHE can be used to override this setting. For more information, see Environment Variables.
3. | Using the comp disk cache size control, pick the maximum size the disk cache can reach. Ensure there is enough space on the disk for this to be reached. The default value is 10 GB, but a larger value, such as 50 GB, can often be used. |
The environment variable NUKE_DISK_CACHE_GB can be used to override this setting. For more information, see Environment Variables.
4. | Click OK to update preferences and then restart Nuke. |
Once these settings are defined, the automatic caching of images is enabled. The Viewer caches each frame it displays in the directory specified. If you add a DiskCache node into your script, it also uses the same directory.
The disk cache is preserved when you quit Nuke so it can be used again later. However, when the cache becomes full, old items are automatically deleted to make room for newer items.
Clearing the Disk Cache
When the disk cache becomes full, old items are automatically deleted. If necessary, you can also empty the disk cache manually. You may want to do this if, for some reason, wrong images are displayed in the Viewer.
To Empty the Disk Cache
From the menu bar, select Cache > Clear Disk Cache.