SUMMARY

This article explains how to set knob defaults for file format specific knobs, otherwise known as context sensitive or dynamically updating knobs.

MORE INFORMATION

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:

nuke.knobDefault(“nodeClass.knobName”, “value”).

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:

The 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 init.py or menu.py in the users .nuke directory to apply to future Nuke sessions.

FURTHER READING

More information about the knobDefault() command can be found in our Python reference guide: