ID 607884 - Knobs evaluated via Python or TCL can return "None" instead of "" if an expression evaluates to an empty string

Follow

Problem summary:

Knobs evaluated via Python or TCL can return "None" instead of "" if an expression evaluates to an empty string
 

Customer reported version:
Nuke 16.0v6

 

Customer reported platform:
Rocky9

 

Steps to reproduce:
1) Launch Nuke and open the Script Editor
2) Execute the following code and observe the output:

print(nuke.NUKE_VERSION_STRING) knobs = ["file", "proxy", "label"] expression = "[value root.name]" w = nuke.nodes.Write() r = nuke.nodes.Read() gi = nuke.nodes.GeoImport() noop = nuke.nodes.NoOp() nodes = [w,r,gi,noop] for n in nodes:     print(n.name())     for knob in knobs:         if knob in n.knobs():             n[knob].setValue(expression)             print(f"\t{knob}: {n[knob].evaluate()}")

 

Alternative Steps:

1) Launch Nuke and navigate to Edit > Project Settings... 

2) Add the following expression to the name field: [python {""}]

3) Create a Text node, and add this expression to its message knob: [value root.name]

4) Observe how the Text node displays "None"


Expected behavior:
Evaluated expressions should be able to return empty strings. 

 

Actual behavior:
TCL expressions that resolve to empty strings, such as [value root.name] in an unsaved Nuke script, now return "None" instead of "" when evaluated.

 

Workaround:
No known workaround at this time.

 

Reproduced by Support in:
Nuke 16.0v6 - Windows 11, macOS 14 Sonoma
Nuke 16.0v5 - Windows 11, macOS 14 Sonoma -- Regression
Nuke 15.2v5 - Windows 11, macOS 14 Sonoma -- Regression
 

Unable to reproduce bug in:
Nuke 16.0v4 - Windows 11, macOS 14 Sonoma
Nuke 15.2v4 - Windows 11, macOS 14 Sonoma
Nuke 15.2v6 - Windows 11, macOS 14 Sonoma

 

Earliest version tested:
Nuke 15.2v4 - This issue doesn't appear in this version and has regressed

    We're sorry to hear that

    Please tell us why