ID 605767 - GSVs changed by the user, then changed by a knobChanged callback, do not update in the UI

Follow

Problem summary
GSVs changed by the user, then changed by a knobChanged callback, do not update in the UI.
 
Customer reported version
Nuke 16.0v4
 
Customer reported platform
Windows 10
 
Steps to reproduce
 
1) Open Nuke.
 
2) Go to Edit > Project Settings and open the Variables tab. Set two separate variables, like so:
 

 
 
3) Execute the following code in the Script Editor to create the knobChanged callback:

def test():    if nuke.thisKnob() == nuke.Root()["gsv"]:        nuke.Root()["gsv"].setGsvValue("frame", "1001")nuke.addKnobChanged(test)
 
4) Change the value of your name variable and see that frame gets changed to 1001.
 
5) Change the value of the frame variable, to anything other than 1001. It will not get changed in the UI by the callback.
 
6) Run the following code in the Script Editor which will return 1001 (ie. not what is displayed in the Variables tab UI):
nuke.Root()["gsv"].getGsvValue("frame")
 
The value will update in the UI after saving, closing and reopening the script.
 
Expected behaviour
The GSV value should always be updated in the UI to match its actual value.
 
Actual behaviour
The GSV value does not get updated in the UI, even though the knob value is correctly changed.
 
Workaround
Unknown. 
 
Reproduced by support
This bug has been reproduced in:
Nuke 16.0v4 - Windows 11 - Linux Rocky 9
Nuke 15.1v1 - Windows 11 - Linux Rocky 9 
 
Earliest version tested
Nuke 15.1v1
- Multishot and GSVs did not exist before this version
 

    We're sorry to hear that

    Please tell us why