One way would be to store it in a pyscript knob
node = nuke.createNode('NoOp') node.addKnob(nuke.PyScript_Knob("script","script",'''def printer(string): print string printer("hello123")''')) -- Hugo Léveillé Head of 2D, MELS On Thu, Mar 2, 2017, at 05:17, Fredrik Averpil wrote: > Hi, > I’m trying to figure out how I can store a function on a node. > This doesn’t work: > *def* *printer*(string): print(string) node = nuke.createNode('NoOp') > node.printer = printer > > Any ideas? > Cheers, > Fredrik > > _________________________________________________ > Nuke-python mailing list > Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________ Nuke-python mailing list Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python