ID 249418 - Adding Custom User Knobs to Write Nodes does not work correctly

Follow

Problem summary
Adding custom knobs to Write nodes makes the custom knobs appear in the root node instead of the write node.

Customer reported version
Nuke.10.0v4

Customer reported platform
CentOS 6

Steps to reproduce

1) Open NukeStudio

2) Open the Script Editor panel

3) Run the following:

ns = hiero.core.nuke.Script.ScriptWriter()
wn = hiero.core.nuke.WriteNode('/tmp/test.jpg')
wn.addCheckboxKnob('test_knob', 'Test')
ns.addNode(wn)
ns.writeToDisk('/tmp/test.nk')

 

4) Navigate to the specified path, in this case the /tmp/ directory, and open the file in a text editor.

5) Results: The UserKnob is specified within the root node rather than the 'Write' node.

   addUserKnob {6 test_knob l "Test"}
   test_knob False
Write { 
   file "/tmp/test.jpg"
}

 

Workaround
1) Open the file /Nuke<version>/pythonextensions/site-packages/hiero/core/nuke/Node.py in a text editor.

2) Find lines 304 and 305:

 serializer.serializeUserKnobs(userKnobs)
 serializer.serializeRawKnobs(rawKnobs)


3) Move these lines down to just above the following:

 serializer.endSerializeNode()

 

4) Result adds User Knob to the Write node but still includes it in the root, as well.

Reproduced by support
OS: Windows 7, Linux CentOS 6
Versions: 9.0v1, 10.0v1, 10.0v4, 10.0v5, 10.5v1

Expected behaviour
The addUserKnob should appear within the containment of the Write node, for instance:
 
Write { 
 file "/tmp/test.jpg"
 addUserKnob {6 test_knob l "Test"}
 test_knob False
}


Actual behaviour
The addUserKnob appears within the containment of the Root node outside of the Write node parameters,

 addUserKnob {6 test_knob l "Test"}
 test_knob False
Write { 
 file "/tmp/test.jpg"
}
 

    We're sorry to hear that

    Please tell us why