ID 552205 - nuke.knobDefault() can prevent file format specific knobs embedded in Gizmos from saving

Follow

Problem summary:
nuke.knobDefault() can prevent file format specific knobs embedded in Gizmos from saving
 
Customer reported version:
Nuke 12.2v10
 
Customer reported platform:
Ubuntu
 
Steps to reproduce:
1) Download the attached TestGizmo.gizmo and place it inside the ~/.nuke directory.
2) Add the following code to the ~/.nuke/init.py file:

nuke.knobDefault("TestGizmo.file_type","exr")nuke.knobDefault("TestGizmo.datatype", "32 bit float")nuke.knobDefault("TestGizmo.compression", "PIZ Wavelet (32 scanlines)")nuke.knobDefault("TestGizmo.raw","True")nuke.knobDefault("TestGizmo.render_order","12")nuke.knobDefault("TestGizmo.frame_mode","offset")nuke.knobDefault("Write.file_type","exr")nuke.knobDefault("Write.exr.datatype", "32 bit float")nuke.knobDefault("Write.exr.compression", "PIZ Wavelet (32 scanlines)")nuke.knobDefault("Write.raw","True")nuke.knobDefault("Write.render_order","12")nuke.knobDefault("Write.frame_mode","offset")
3) Launch Nuke and create a TestGizmo node.
4) Copy and paste the TestGizmo node in the Node Graph, and observe how the file format specific knobs (datatype and compression) have not been saved correctly:

 
Expected behavior:
Setting a knobDefault() for both a user knob and Class knob that is file format specific should not prevent the user knob from saving its value.
 
Actual behavior:
Gizmo knobs that are file format specific do not save their values set by nuke.knobDefault(), if nuke.knobDefault() has also been used on the original Class knob embedded in the Gizmo.
 
Workaround:
Removing the Write node knobDefaults (Write.exr.datatype, and Write.exr.compression) allows the TestGizmo knobs to save correctly. However, this means that the Write node and TestGizmo knobDefaults are mutually exclusive, and only one can be active at a time.

If it's necessary/desired to have both the Write node and TestGizmo knobDefaults, adding the ALWAYS_SAVE flag to the TestGizmo knobs is a viable workaround.
 
Reproduced by Support in:
Nuke 14.0v5 - Windows 10, CentOS 7
Nuke 14.0v1 - Windows 10
Nuke 13.0v1 - Windows 10
Nuke 12.0v1 - Windows 10
Nuke 11.0v1 - Windows 10
Nuke 10.0v1 - Windows 10, CentOS 7
 
Earliest version tested:
Nuke 10.0v1 - This issue appears to be in all tested versions of the product

    We're sorry to hear that

    Please tell us why