Q100158: Generating multiple autosaves for your Nuke script

SUMMARY

This article explains how you can customize Nuke's autosave functionality to implement a rolling and incremental autosave system.

 

MORE INFORMATION

By default, Nuke will only keep one autosave for the current file you're working on. The file will be called <scriptname>.nk.autosave and will be updated/overwritten at the frequency set in your Nuke Preferences.

You can customize Nuke's autosave behavior by setting up your own autosave Python functions. The example code attached below (from the Nuke Python Developer's Guide) will set up a rolling autosave to store multiple incremental backups of your work in progress script.

This can be set up by doing the following:

  1. Download the attached autosave.py file and place it in the active user's ~/.nuke directory
  2. Add the following line to the init.py file in your ~/.nuke directory: import autosave

If you do not already have an init.py file in your ~/.nuke directory, you will need to create one.

After the code is installed, Nuke will create multiple incremental autosave files the next time it is launched, like this:

<scriptname>.nk.autosave
<scriptname>.nk.autosave1
<scriptname>.nk.autosave2
...
<scriptname>.nk.autosave9

If you encounter any problems with Nuke, such as crashing or corrupted scripts, then you can load each autosave using File > Open to find a script before the problem occurred.

 

FURTHER READING

Nuke's online documentation has more information about how to load custom Python scripts and other customizations.
The Nuke Python Developer's Guide has more information about how to use Python callbacks like onAutoSave.
 

ATTACHMENTS

We're sorry to hear that

Please tell us why