ID 533081 - Nuke crashes when setValue() is used on a Shuffle node's mappings knob from a custom Python panel

Follow

Problem summary:
Nuke crashes when setValue() is used on a Shuffle node's mappings knob from a custom Python panel
 
Customer reported version:
Nuke 13.2v5
 
Customer reported platform:
Windows 10
 
Steps to reproduce:
 
1) Launch Nuke and open the Script Editor panel.
2) Copy and paste the following code into the Script Editor:
class TestPanel(nukescripts.PythonPanel):    def __init__(self):        nukescripts.PythonPanel.__init__(self, "Test Panel")        self.testKnob = nuke.Enumeration_Knob("element1", "element1", ["Test1", "Test2"])        self.addKnob(self.testKnob)    def knobChanged(self, knob):        print("Knob changed: " + str(knob.name()))        self.zconnect()    def zconnect(self):        zshuffle = nuke.createNode("Shuffle2")        zshuffle.knob("out1").setValue("depth")        zshufflemap = zshuffle.knob("mappings")        zshufflemap.setValue("rgba.red", "depth.Z")pane = nuke.getPaneFor("DAG.1")p = TestPanel()p.addToPane(pane)
3) Run the code and change the element1 knob from Test1 to Test2, and observe Nuke's performance.
 
Expected behavior:
Nuke should handle the code inside the zconnect() function without issue.
 
Actual behavior:
Nuke becomes unstable and crashes when setValue() is attempted on the mappings knob from a custom Python Panel.
 
If the code inside the zconnect() function is executed directly from the Script Editor and not from a custom Python panel, the crash does not occur.  
 
Workaround:
Instead of using Shuffle2's mappings knob, it is possible to achieve equivalent results with the original Shuffle node. This could be done by replacing the zconnect() function with the following example code that maps the rgba.green channel to depth.Z:
def zconnect(self):     zshuffle = nuke.createNode("Shuffle")     zshuffle.knob("out").setValue("depth")     zshuffle.knob("red").setValue("green") 

Alternatively, the Shuffle2 node could be replaced with a Merge node that is set to the desired output channel, pictured below:

Reproduced by Support in:
Nuke 16.0v8 - Windows 10, Rocky 9
Nuke 14.0v1 - Windows 10
Nuke 13.0v1 - Windows 10
Nuke 12.1v1 - Windows 10, CentOS 7

Earliest version tested:
Nuke 12.1v1 - This feature (Shuffle2 node) did not exist before this version 

    We're sorry to hear that

    Please tell us why