ID 135206 - Calling node.dependencies() or node.dependent() returns inconsistent results for nuke.EXPRESSION in Terminal mode

Follow

Problem summary:
Calling node.dependencies() or node.dependent() returns inconsistent results for nuke.EXPRESSION in Terminal mode

 

Customer reported version:
Nuke 13.2v6

 

Customer reported platform:
Windows 10

 

Steps to reproduce:
1) Launch Nuke and paste the following nodes into the Node Graph:

set cut_paste_input [stack 0]ColorWheel {inputs 0gamma 0.45rotate 39name ColorWheel1xpos 70ypos -177}Transform {scale {{Grade1.multiply}}center {1024 778}name Transform1xpos 70ypos -57}push $cut_paste_inputGrade {multiply 0.74name Grade1xpos 180ypos -153}NoOp {inputs 0name NoOp1xpos -40ypos -57addUserKnob {20 User}addUserKnob {7 test l "test knob"}test {{ColorWheel1.rotate}}}

2) Open the Script Editor window and run the following lines of code, noting the output:

dencies = nuke.toNode("Transform1").dependencies()dent = nuke.toNode("ColorWheel1").dependent()print(f'Transform node dependencies are: {[n.name() for n in dencies]}')print(f'ColorWheel dependent nodes are: {[n.name() for n in dent]}')
#Output:Transform node dependencies are: ['ColorWheel1', 'Grade1']ColorWheel dependent nodes are: ['NoOp1', 'Transform1'] 

3) Save this Nuke script and open it in Terminal mode with the -t command line flag, like so: "C:\Program Files\Nuke15.1v3\Nuke15.1.exe" -t path/to/the/nuke_script.nk

4) Run the code from step 2 inside the Terminal, and observe how the Expression linked nodes (Grade1 and NoOp1) are not returned:

5) Execute the code again, and note how node.dependencies() now returns the same results as it does in the GUI:

 

Expected behavior:
Using the dependencies() or dependent() methods on a node should return the same results in the GUI and in Terminal mode.

 

Actual behavior:
When attempting to call node.dependencies() or node.dependent() in the Terminal, nuke.EXPRESSION does not always return the expected results.

 

Workaround:
For node.dependencies(), it appears that calling node.dependent() beforehand on any node can produce the expected results, but it is possible this may not work in all circumstances:

 

Reproduced by Support in:

Nuke 15.1v3 - Windows 10, macOS 14 Sonoma
Nuke 14.0v1 - Windows 10
Nuke 13.0v1 - Windows 10
Nuke 12.0v1 - Windows 10

 

Earliest version tested:
Nuke 12.0v1 - This issue appears to be in all tested versions of the product

    We're sorry to hear that

    Please tell us why