ID 603006 - Enumeration knob value can no longer be set using setValue to it's string value if the values starts with a space/ " "

Follow

Problem summary
Enumeration knob value can no longer be set using setValue to it's string value if the values starts with a space/ " "

In Nuke, this affects users being able to set the monitorOutPixelFormat knob, or custom knobs with values starting with a space

Customer reported version
nuke.16.0v1

Steps to reproduce
1) Launch Nuke

2) Run the below Python code, not all cases return True:

n = nuke.nodes.NoOp() k = nuke.Enumeration_Knob("enum", "enum", [" ", "Test1", " Test2"]) n.addKnob(k) print(n["enum"].setValue("Test1")) print(n["enum"].setValue(" ")) print(n["enum"].setValue(" Test2")) 

Expected behaviour
For the setValue to be able to set the string values of enumeration knobs

Actual behaviour
If fails to set the string value

Workaround
Set the value using it's index, for example:

print(n["enum"].setValue(n["enum"].values().index(" "))) print(n["enum"].setValue(n["enum"].values().index(" Test2")))

Reproduced by support
Nuke 16.0v4 - Windows 11, macOS Sonoma
Nuke 16.0v1 - Windows 11
Nuke 15.2v1 - Windows 11, macOS Sonoma - regression

Unable to reproduce bug in:
Nuke 15.1v8 - Windows 11, macOS Sonoma

 

Earliest version tested
Nuke 15.1v8 - This issue doesn't appear in this version and has regressed

    We're sorry to hear that

    Please tell us why