ID 581553 - Incorrect results can be returned when using node.knob.frame() or the "frame" expression on certain nodes upstream of a TimeOffset

Follow

Problem summary:
Incorrect results can be returned when using node.knob.frame() or the frame expression on certain nodes upstream of a TimeOffset 
 
This issue has been observed with NoOp, Input, Output, Group, and Dot nodes, but may affect other nodes as well.
 
Customer reported version:
Nuke 14.1v4
 
Customer reported platform:
CentOS 7
 
Steps to reproduce:
1) Launch Nuke and create a NoOp node in the Node Graph.
2) Create a Text node, and enter frame: [frame] into the message knob.


3) Create a TimeOffset node, and set the time_offset knob to a value other than 0:

4) View the TimeOffset node, and run the following code in the Script Editor window:

n = nuke.toNode("NoOp1")k = n.knob("hide_input")print(k.frame())
5) Observe how the print() statement matches the Text node's expression in the Viewer.
6) Change the current frame to a new value, and run the code again, observing how knob.frame() no longer matches the Text node:

 
Expected behavior:
node.knob.frame() and the frame expression should consistently produce accurate results and account for any TimeOffset nodes being Viewed. 
 
Actual behavior:
With certain nodes (such as NoOp, Input, Output, Group, and Dot), calling node.knob.frame() does not always evaluate correctly when a TimeOffset node is being Viewed downstream. This same issue occurs when utilizing the frame expression on a knob belonging to one of the affected Node Classes.

For example, when opening the following NoOp node's Properties and Viewing the TimeOffset node, the frame expression in the NoOp's "test" knob will not return the correct values once the current frame is adjusted: 
NoOp {name NoOp1addUserKnob {20 User}addUserKnob {3 test l "" +STARTLINE}test {{frame}}}TimeOffset {time_offset 10time ""name TimeOffset1}
 
Disconnecting and then reconnecting the Viewer to the TimeOffset node can temporarily allow knob.frame() and frame expressions to return the expected results, but incorrect values will be returned again once the current frame is updated.
 
Workaround:
If possible, utilize a node that is unaffected by this issue, such as the PostageStamp or Grade nodes:

 
Reproduced by Support in:
Nuke 15.1v1 - Windows 10, macOS 13 Ventura
Nuke 14.1v4 - Windows 10
Nuke 14.1v1 - Windows 10
Nuke 14.0v6 - Windows 10 - Regression
 
Unable to reproduce bug in:
Nuke 14.0v5 - Windows 10
 
Earliest version tested:
Nuke 14.0v5 - This issue doesn't appear in this version and has regressed

    We're sorry to hear that

    Please tell us why