Create a ticket

Q100458: Customising existing Nuke Studio export tokens


This article explains how to find the list of usable export tokens in Nuke Studio and add extra tokens allowing users to further customise the export paths used in the exporter.


Export tokens inside the Nuke Studio Exporter are special keywords which resolve into a string based on the task which has been selected to be exported. For example, the {shot} export token returns the name of the shot to be exported, and the token is only available when exporting shots. Other tokens, such as the {user} token, which returns the name of the user using the exporter, can be used when exporting sequences, shots or clips.

The list of usable tokens can be seen by:

  • Hovering over path template and reading the tool tip

  • Right clicking on an active path template and selecting Select keyword…


Extra tokens can be added using Python which can allow them to work better in particular environments, such as in a production pipeline.

To do so, resolvers need to be added, which are called for a particular keyword and return the string to be used in the final path, in place of the token.

Resolvers can be added by overriding an instance of:


If you override the main hiero.core.TaskPresetBase.addUserResolveEntries, then the resolvers will be added to all export processors.

However, if you override one of other instances of addUserResolveEntries, such as hiero.exporters.FnShotProcessor.ShotProcessorPreset.addUserResolveEntries, then the resolver will only be added to the shot export processors.



Below is an example of how to add a global export token: 

import hiero.core
def global_addUserResolveEntries(self, resolver):
resolver.addResolver("{proj}", "First four characters of the project.", lambda keyword, task: task.projectName()[:4])
# This token can be applied to ANY export process, so add it to the base class
hiero.core.TaskPresetBase.addUserResolveEntries = global_addUserResolveEntries

This example returns the first 4 characters of the project name, by calling task.projectName()[:4], which returns the full name of the project, then uses Python string syntax to return only the first 4 characters.

The addResolver() function requires three arguments, the name (keyword) of the token, the description of the token, which will appear in the tooltip and Select Keyword dialog, and the resolver, which is the function which returns the string that will be used in the path in place of the token.



Below is an example of how to add a shot specific export token: 

from hiero.exporters.FnShotProcessor import ShotProcessorPreset
def shot_addUserResolveEntries(self, resolver):
def plateWidth(task):
trackItem = task._item
media = trackItem.source().mediaSource()
return str(media.width())

resolver.addResolver("{platewidth}", "Returns the width of the source plate", lambda keyword, task: plateWidth(task))

resolver.addResolver("{plateheight}", "Returns the height of the source plate", lambda keyword, task: str(task._item.source().mediaSource().height()))

# This token will only be applied to the Shot Processor
ShotProcessorPreset.addUserResolveEntries = shot_addUserResolveEntries

This example returns the string of the source plate width/height. The width is found by calling the plateWidth() function, which returns the string of the media sources .width() method. The height is found in the same way, however it is done in a single line, rather than calling another function. As both revolvers are added to the shot_addUserResolveEntries() function, they are both add to the shot export processors when overriding addUserResolveEntries.

Running the above examples in the Script Editor will add those tokens to the exporter for that Nuke Studio session. To check the tokens are working correctly, add the tokens to the path and check the path preview in the Exporter, in this case the resolution of the full HD footage is returned:

Tokens can be permanently added to the Nuke Studio setup by adding them to the .nuke/Python/Startup/ file, creating one if it doesn’t already exist.


More information about the Nuke Studio export system can be found in our documentation here: 

Export System

Information about finding the .nuke directory can be found here:

Q100048: Nuke Directory Locations

Information about the Python/Startup/ can be found here:

Q100142: How to execute Hiero Python code in Nuke Studio on startup

Was this article helpful?

We're sorry to hear that!

Please tell us why.
2 out of 3 found this helpful