ID 268671 - nuke.PythonCustomKnob.getObject() returns different values when run in terminal mode compared to a Nuke interactive session

Follow

Problem summary
nuke.PythonCustomKnob.getObject() returns different values when run in terminal mode compared to a Nuke interactive session

Customer reported version
nuke.10.5v2

Customer reported platform

Steps to reproduce

1) Download the attached Python file

2) Open a command window and run the below command:

<Nuke> -t --tg <pathtodownload>/PythonCustomBug.py
This will print:

<PythonCustomKnob object at 0x0000000008CDC120>

None


3) Now run the below command:
<Nuke> <pathtodownload>/PythonCustomBug.py
In the Nuke script editor, this will print:

<__main__.MyWidget object at 0x000000004A2AE908>

<__main__.MyWidget object at 0x000000004A2AE908>

<PythonCustomKnob object at 0x00000000083C3D08>

<__main__.MyWidget object at 0x000000004A2AE908>


Reproduced by support
This problem has been reproduced on:
Nuke 10.5v2 - Windows 10 - CentOS 6.8 - MacOSX 10.12
Nuke 10.5v1 - Windows 10
Nuke 10.0v6 - Windows 10
Nuke 10.0v1 - Windows 10
Nuke 9.0v9 - Windows 10
Nuke 8.0v6 - Windows 10 - CentOS 6.8 - MacOSX 10.12

Expected behaviour
For the same result from Nuke command line and Nuke terminal mode

Actual behaviour
Different results from running the same Python script

    We're sorry to hear that

    Please tell us why