ID 525530 - MatchGrade fails to write the LUT output file when executed Pythonically after analyzing frames

Follow

Problem summary
MatchGrade fails to write the LUT output file when executed Pythonically after analyzing frames
 
Customer reported version
nuke.13.2v2
 
Customer reported platform
centos7
 
Steps to reproduce
 
1) Open NukeX

2) In the Script Editor, run the below code, changing the outfile path to a valid path:
 
ch = nuke.nodes.CheckerBoard2() co = nuke.nodes.ColorWheel() mg = nuke.nodes.MatchGrade() mg.setInput(0, ch) mg.setInput(1, co) mg.knob('outfile').setValue('/change/me/lut.csp') mg.knob('sourceRefFrames').setValue(mg.firstFrame()) mg.knob('addSourceRefFrame').execute() mg.knob('analyzeRefFrames').execute() print(mg['lutExists'].value()) mg.knob('writelut').execute()
 
The Script Editor prints True, but a dialog appears saying "LUT does not exist. Please press 'Analyze Reference Frames' to compute the LUT".
 
The same thing happens if you run the code in terminal mode. 
 
Expected behaviour
For the LUT to be exported
 
Actual behaviour
The LUT fails to be written, saying the LUT does not exist, even though mg['lutExists'].value() returns True:
 

 

 
- It's also noted that an error can occur in terminal mode with the message: "DDImage ERROR: Filename is empty", where performing the workaround below fixes the issue and the LUT is written correctly.

Workaround
If you use forceValidate() on the node before executing the writelut knob, then it exports correctly, so in the case of the example code:
 
ch = nuke.nodes.CheckerBoard2()co = nuke.nodes.ColorWheel()mg = nuke.nodes.MatchGrade()mg.setInput(0, ch)mg.setInput(1, co)mg.knob('outfile').setValue('/change/me/lut.csp')mg.knob('sourceRefFrames').setValue(mg.firstFrame())mg.knob('addSourceRefFrame').execute()mg.knob('analyzeRefFrames').execute()print(mg['lutExists'].value())mg.forceValidate() mg.knob('writelut').execute()
 
Reproduced by Support in:
NukeX 15.1v5 - Windows 10, macOS 13 Ventura
NukeX 13.2v5 - Windows 10, CentOS 7, macOS Monterey
NukeX 10.0v1 - CentOS 7
NukeX 9.0v1 - Windows 10
 
Earliest version tested
NukeX 9.0v1 - This issue appears to be in all tested versions of the product
 

    We're sorry to hear that

    Please tell us why