ID 227287 - [OCIO] - Not attached to node error caused by Python colorspace callback

Follow

Problem summary

On loading a script, Python callbacks cause a "ValueError: A PythonObject is not attached to a node" and errors in the Read nodes.

 

Steps to reproduce

 
1) Add this code to menu.py:
 

  import nuke

    def onCreate():

    node = nuke.thisNode()

    # Just calling node.metadata will create the errors in the terminal

    metadata = node.metadata()

nuke.addOnCreate(onCreate, nodeClass='Read')

2) Open Nuke and load a script that contains a Read node reading in an exr.

3) Result: Read node gives error "Python error mapping colorspace" and you get the following Traceback:

Traceback (most recent call last):
File "C:/Program Files/Nuke10.0v3/plugins\nuke\colorspaces.py", line 132, in defaultColorspaceMapper
colorspace = _nukeDefaultColorSpaceMapper(colorspace, dataTypeHint)
File "C:/Program Files/Nuke10.0v3/plugins\nuke\colorspaces.py", line 74, in _nukeDefaultColorSpaceMapper
retName = _lookUpDataTypeDefaultSettings(colorspaceName, dataTypeHint)
File "C:/Program Files/Nuke10.0v3/plugins\nuke\colorspaces.py", line 64, in _lookUpDataTypeDefaultSettings
retString = getKnobValue( "floatLut" )
File "C:/Program Files/Nuke10.0v3/plugins\nuke\colorspaces.py", line 50, in getKnobValue
return nuke.root()[ knobName ].value()
ValueError: A PythonObject is not attached to a node

 

    We're sorry to hear that

    Please tell us why