Hi,

I am having trouble setting Text2's font knob from callback,
and it gives out following error:

Traceback (most recent call last):
  File "C:/Program Files/Nuke8.0v3/plugins\nuke\callbacks.py", line 127, in 
knobChanged
    _doCallbacks(knobChangeds)
  File "C:/Program Files/Nuke8.0v3/plugins\nuke\callbacks.py", line 44, in 
_doCallbacks
    for f in list:
TypeError: an integer is required

Following is a code that reproduce the error:
n = nuke.createNode("Text2")

knob = nuke.Enumeration_Knob("test", "test", ["1", "2"])
n.addKnob(knob)

def knob_callback():
    node = nuke.thisNode()
    knob = nuke.thisKnob()
    
    knob_name = knob.name()
    if knob_name == "test":
        key = knob.value()
        if key == "1":
            node["font"].setValue("Utopia", "Regular")
        else:
            node["font"].setValue("Courier", "Regular")

nuke.addKnobChanged(knob_callback, nodeClass=n.Class())
n["test"].setValue(2)


Does anyone know why python is raising TypeError?
I've never seen a error like this in a for statement.

Thanks,
Taku


_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to