State:Closed|icon_bug|icon_nuke|database:public|Resolution:Fixed|TargetRelease:16.0v5|BugID:595867|
Problem summary:
Knobs containing GSVs do not always return the correct result when evaluated via Python
Customer reported version:
Nuke 16.0v1
Customer reported platform:
Windows 11
Steps to reproduce:
1) Launch Nuke and open the Script Editor
2) Paste in the following lines and execute this code:
root_node = nuke.root() gsv_knob = root_node['gsv'] gsv_knob.setGsvValue('__default__.shot', 'test') write = nuke.createNode("Write") write['file'].setValue("%shot") print(f"Write node GSV evaluates correctly to: {write['file'].evaluate()}") text = nuke.createNode("Text2") text['message'].setValue("%shot") print(f"Text node GSV evaluates incorrectly to: {text['message'].evaluate()}")3) Observe the output, where the Text node's GSV is not resolved and returns %shot:Knob.evaluate() method does not always return the correct expanded result and may return the same output as the Knob.getText() method..evaluate() method is called, but a File_Knob added to a NoOp node does not resolve the GSV:root_node = nuke.root() gsv_knob = root_node['gsv'] gsv_knob.setGsvValue('__default__.shot', 'test') write = nuke.createNode("Write") write['file'].setValue("%shot") print(f"Write node's GSV on a {type(write['file'])} evaluates correctly to: {write['file'].evaluate()}") noop = nuke.createNode('NoOp') file_knob = nuke.File_Knob("file","File") noop.addKnob(file_knob) noop["file"].setValue("%shot") print(f"NoOp node's GSV on a {type(noop['file'])} evaluates incorrectly to: {noop['file'].evaluate()}")
We're sorry to hear that
Please tell us why