ID 573442 - The Cryptomatte node's sidecarFilepath knob cannot be set via Python unless the node's control panel is open in the GUI

Follow

Problem summary:
The Cryptomatte node's sidecarFilepath knob cannot be set via Python unless the node's control panel is open in the GUI
 
Customer reported version:
Nuke 14.1v2
 
Customer reported platform:
CentOS 7
 
Steps to reproduce:
1) Launch Nuke and create a Read node in the Node Graph.
2) Select some cryptomatte footage to open, such as the sample images available here.
3) Create a Cryptomatte node and close its Properties.
4) Run the following code in the Script Editor:
path = "C:/tmp/" crypto = nuke.toNode("Cryptomatte1") #set Manifest Source to Custom Sidecar crypto["manifestSourceExtended"].setValue(3) #set the sidecarFilepathcrypto["sidecarFilepath"].setValue(path)#check the values of the customSidecar and sidecarFilePath knobsprint("sidecarFilepath: %s"%crypto["sidecarFilepath"].value()) print("customSidecar: %s"%crypto["customSidecar"].value())
5) Double-click the Cryptomatte node to open its Properties, and observe how the sidecarFilepath knob was not set. Then, run the code again and notice how the sidecarFilepath is set correctly:
 
Alternative Steps:
1) Launch Nuke in Terminal mode with the -t flag.
2) Run the following commands: 
read = nuke.nodes.Read(file = "path/to/the/cryptomatte_footage.exr")crypto = nuke.createNode("Cryptomatte")crypto.setInput(0, read)path = "C:/tmp/"#set Manifest Source to Custom Sidecarcrypto["manifestSourceExtended"].setValue(3)#set the sidecarFilepathcrypto["sidecarFilepath"].setValue(path)#check the values of the customSidecar and sidecarFilePath knobsprint("sidecarFilepath: %s"%crypto["sidecarFilepath"].value())print("customSidecar: %s"%crypto["customSidecar"].value())#save, clear, and reopen the scriptnuke.scriptSaveAs("C:/tmp/my_script.nk",1)nuke.scriptClear()nuke.scriptOpen("C:/tmp/my_script.nk")#check the values of the customSidecar and sidecarFilePath knobscrypto = nuke.toNode("Cryptomatte1")print("sidecarFilepath: %s"%crypto["sidecarFilepath"].value())print("customSidecar: %s"%crypto["customSidecar"].value())
3) Observe how the sidecarFilepath knob appears to have been set, but its value is lost when the Nuke script is reopened:
 
Expected behavior:
Setting a Cryptomatte's sidecarFilepath knob via Python should succeed without needing to open the node's Properties.
 
Actual behavior:
When setting a Cryptomatte node's sidecarFilepath knob with Python, the knob is not actually set unless the Cryptomatte's Properties are open while the code is executed.
If the sidecarFilePath is manually set in the UI, the customSidecar knob is also updated automatically, and both knobs are set correctly when node.["sidecarFilePath"].setValue(path) is run with the Properties open.
 
If the Cryptomatte node's Properties are closed and it is not connected to any other nodes when the sidecarFilepath knob is set, the path will look visually correct when the Cryptomatte's Properties are opened next. However, this knob value is not saved when the Nuke script is reopened, or if the Cryptomatte node is then connected to a Read node:

 
Workaround:
Instead of setting only the sidecarFilepath knob, also set the customSidecar knob:
path = "C:/tmp/" crypto = nuke.toNode("Cryptomatte1") #set Manifest Source to Custom Sidecar crypto["manifestSourceExtended"].setValue(3) #set the sidecarFilepath and customSidecarcrypto["sidecarFilepath"].setValue(path)crypto["customSidecar"].setValue(path)#check the values of the customSidecar and sidecarFilepath knobsprint("sidecarFilePath: %s"%crypto["sidecarFilepath"].value()) print("customSidecar: %s"%crypto["customSidecar"].value())
 
Reproduced by Support in:
Nuke 15.0v4 - Windows 11, macOS 13 Ventura
Nuke 15.0v1 - Windows 11
Nuke 14.1v1 - Windows 11, macOS 13 Ventura
 
Earliest version tested:
Nuke 14.1v1 - This feature (the Cryptomatte's manifestSourceExtended and customSidecar knobs) did not exist before this version 

    We're sorry to hear that

    Please tell us why