ID 215970 - Sample function does not work in some situations in Nuke 9.0v8 onwards

Follow

Problem summary
Sample command does not work in Nuke 9.0v8 onwards. This applies to both the nuke.sample() python command and the [sample] TCL expression. 

Customer reported version
nuke.9.0v8

Customer reported platform
windows7

Steps to reproduce

1) Open the attached constantPickerTest.nk script in Nuke 9.0v7.

2) Select the Constant1 node, and open the User tab of the Properties panel. 

3) Drag around the samplePoint in the viewer, the Constant1 node will change to match the colour of the selected point.

4) Open the attached constantPickerTest.nk script in Nuke 9.0v8.

5) Select the Constant1 node, and open the User tab of the Properties panel. 

6) Drag around the samplePoint in the viewer, the Constant1 node will mostly be black, although somtimes the postage stamp holds a colour.​ Also disconnecting an input to the Merge1 node will sometimes update the colour on the Constant1 postage stamp, but if you look at the Constant1 node, then it returns to black.

Reproduced by support
The problem was reproduced with varying results:

The below versions worked without issue:

Nuke 7.0v10 Windows 10
Nuke 8.0v1 Windows 10​
Nuke 8.0v6 Windows 10​
Nuke 8.0v6 Linux CentOS 6.7
Nuke 8.0v6 MacOS 10.11​

The postage stamp for the below versions only worked when the Viewer was connected to Constant1 node, otherwise the postage stamp would be black, however the colour values on the Constant1​ node would be correct. 

Nuke9.0v1 Windows 10
Nuke9.0v1 Linux CentOS 6.7​
Nuke9.0v1 MacOS 10.11​
Nuke9.0v2 Windows 10​
Nuke9.0v3 Windows 10​​

The below versions worked without issue:​

Nuke9.0v4 Windows 10​​
Nuke9.0v5 Windows 10​​​
Nuke9.0v6 Windows 10​​
Nuke9.0v7 Windows 10​​
Nuke9.0v7 Linux CentOS 6.7​
Nuke9.0v7 MacOS 10.11​​

The below versions only returned black, also if you use the nuke.sample command​ in these versions, then it always returns 0, whereas earlier versions would return the correct values:

Nuke9.0v8 Windows 10​​
Nuke9.0v8 Linux CentOS 6.7​
Nuke9.0v8 MacOS 10.11​​
Nuke10.0v1 Windows 10​​
Nuke10.0v1 Linux CentOS 6.7​
Nuke10.0v1 MacOS 10.11​​
 
These last versions also gives the following error message:
 
ERROR: Constant1.color: unexpected '"' in ""unable to sample node at given location (990, 960) for the current context (may be zoomed in or have a ROI set)""

Expected behaviour
For the Constant1 node to match the colour picked from the Merge1 node.

Actual behaviour
It returns black from Nuke 9.0v8 onwards.

    We're sorry to hear that

    Please tell us why