Q100460: How to set knob defaults for file format specific knobs
This article explains how to set knob defaults for file format specific knobs, otherwise known as context sensitive or dynamically updating knobs.
File format specific knobs are knobs which only appear on nodes after a file format has been set for that node. For example, on the Read and Write nodes, the exr knobs only appear after the file type has been defined.
i.e. EXR Options
Normally, knob defaults can be set by using the following Python command:
However, as these file format specific knobs depend on the file format chosen, accessing them only via their knob name does not work.
In order to set the knob defaults for file specific knobs, such as those under the EXR Options on an exr Read node, the file format needs to be defined when calling the
knobDefault() function, separating the format from the node class and knob name with full stops. So the command would look like:
Below are a couple of usage examples for the above command:
knobDefault() functions can be run in the Script Editor, to apply for any future nodes created in that Nuke session, or they can be added to the
menu.py in the users .nuke directory to apply to future Nuke sessions.
More information about the knobDefault() command can be found in our Python reference guide:
Information about finding the .nuke directory can be found here:
We're sorry to hear that!Please tell us why.