State:New|TargetRelease:No Target|icon_bug|icon_nuke|database:public|Resolution:Fixed|BugID:430359|
Problem summary
Expression linking to a knob, which uses a Python expression, returns the wrong result when the node is attached to the Viewer.
This issue seems to happen specifically when using the value() method, and happens regardless of Expressions Re-evaluation mode being set to "Lazy" or "Always".
The expressions are also not evaluated correctly when rendering via the frame server, or in terminal mode.
Customer reported version
Nuke 12.1v1
Customer reported platform
Linux Suse
Steps to reproduce
1) Open Nuke.
2) Copy the following NoOp into the Node Graph:
set cut_paste_input [stack 0]version 12.1 v1push $cut_paste_inputNoOp { name NoOp1 selected true xpos -320 ypos -171 addUserKnob {20 User} addUserKnob {7 frame} frame {{frame}} addUserKnob {7 pyRoot} pyRoot {{"\[python -execlocal node\\ =\\ nuke.thisNode()\\nvalue\\ =\\ node.knob('frame').value()\\n\\nret=value]"}}} The node has two User Knobs, named "frame" and "pyRoot"
frame to return the current frame value.
node = nuke.thisNode()value = node['frame'].value()ret=value
3) Create a Blur node (this can be any node), without connecting it to the NoOp.
4) Right click the 'size' knob on the Blur > Edit Expression. Then enter the following expression to link it to the pyRoot knob: NoOp1.pyRoot
5) Ensure that the properties panel is open for both the NoOp and the Blur node.
6) Connect the Viewer to the Blur node and change frames. Notice that the values of the pyRoot, and the size knob on the Blur, are a frame behind.
Disconnecting the Blur node from the Viewer returns the correct frame values.
You can then see this issue when rendering, by following the additional steps below:
7) Attach a CheckerBoard node upstream from the Blur.
8) Create a Write node downstream from the Blur, and set it to write out an image sequence.
9) Render the comp in the GUI with frame server enabled, or via the terminal:
nuke -x /path/to/script.nk You should then see that the rendered frames do not appear to have any blur applied to them, as the expression is not evaluated for all frames.
Expected behaviour
All of the expression linked knobs (NoOp1.frame, NoOp1.pyRoot, and Blur1.size) should always have the same value.
Actual behaviour
The NoOp1.pyRoot, and Blur1.size knobs return the value of the previous frame, when the Blur is attached to the Viewer.
Workaround
Using the following code on the pyRoot knob will return the correct value:
frame = nuke.Root()['frame'].value()node = nuke.thisNode()valueAt = node.knob('frame').getValueAt(frame)ret=valueAt
Reproduced by support
This bug has been reproduced in:
Nuke 12.1v1 - Windows 10 - macOS 10.13 (High Sierra) - Linux CentOS 7
Nuke 12.0v1 - Windows 10
Nuke 11.0v1 - Windows 10
Nuke 10.0v1 - Windows 10
Nuke 9.0v1 - Windows 10
Nuke 8.0v1 - Windows 10 - macOS 10.13 (High Sierra)
Earliest version tested
Nuke 8.0v1
- This issue appears to be in all versions of the product
We're sorry to hear that
Please tell us why