State:New|TargetRelease:No Target|icon_bug|icon_nuke|database:public|Resolution:Fixed|BugID:224475|
Problem summary:
Python expressions using value() or getValue() do not create the correct key frames with Edit > Generate...
Customer reported version:
Nuke 13.2v5
Customer reported platform:
macOS 11 Big Sur
Steps to reproduce:
1) Launch Nuke and paste the following NoOp node into the Node Graph:
NoOp {name NoOp1selected truexpos 278ypos -201addUserKnob {20 User}addUserKnob {7 test}test {{frame}}addUserKnob {26 "" +STARTLINE}addUserKnob {20 correct l Correct: n 1}addUserKnob {7 expr_linked l "expr linked"}expr_linked {{this.test}}addUserKnob {7 py_frame l "py frame"}py_frame {{"\[python nuke.frame()]"}}addUserKnob {20 endGroup_1 l endGroup n -1}addUserKnob {20 incorrect l Incorrect: n 1}addUserKnob {7 py_value l "py value"}py_value {{"\[python nuke.thisNode()\\\['test'\\].value()]"}}addUserKnob {7 py_getvalue l "py getvalue"}py_getvalue {{"\[python nuke.thisNode()\\\['test'\\].getValue()]"}}addUserKnob {20 endGroup n -1}addUserKnob {26 "" +STARTLINE}addUserKnob {7 py_workaround l "py workaround"}py_workaround {{"\[python nuke.thisNode()\\\['test'\\].getValueAt(nuke.frame())]"}}}
2) Double click the NoOp node to open its Properties panel.
3) Scrub through the Viewer's frame range, and observe how all the NoOp knobs report the current frame displayed by the test knob.
4) Click on the Animation Menu of the expr linked knob, and select Edit > Generate...

5) In the "Generate keys" window that appears, click OK to convert the expression into keyframes.
6) Repeat steps 4 and 5 for the py frame, py value, and py getvalue knobs
7) Scrub through the frame range again, and observe how only the expr linked, py frame knobs display the correct values:

Expected behavior:
Baking an expression to animated key frames should "cook" properly for all frames, regardless of the expression used to drive the knob.
Actual behavior:
Attempting to bake a Python expression that uses value() or getValue() into key frames with Edit > Generate... will hold the value of the frame it was generated on, and will not update or "cook" on each frame.
Workaround:
Instead of using value() or getValue(), the expression should bake successfully if .getValueAt() is used in conjunction with nuke.frame(). For example, the following Python expression is used in the py workaround knob and will "cook" correctly on each frame after running Edit > Generate...
nuke.thisNode()['test'].getValueAt(nuke.frame())
Reproduced by Support in:
Nuke 14.0v5 - Windows 10, CentOS 7
Nuke 14.0v1 - Windows 10
Nuke 13.0v1 - Windows 10
Nuke 12.0v1 - Windows 10
Nuke 11.0v1 - Windows 10
Nuke 10.0v1 - Windows 10, CentOS 7
Earliest version tested:
Nuke 10.0v1 - This issue appears to be in all tested versions of the product
We're sorry to hear that
Please tell us why