how to create new class based on existing Node

Hi, i like to add some more new function/feature to an existing Node. Trying to do with gizmo but not quite happy with some refreshing issue so i want to do the other way. I’m thinking to create new class base on existing node. Here my attempt just for testing :

Code:

class newblur(nuke.Node):
    def __init__(self):
        nuke.Node.__init__(self)
        self.x=nuke.Int_Knob('test','test')
        self.addKnob(self.x)

a=newblur('Blur')


it creates a Node with no error, but as you can see in my script , i’m trying to add new knob . But there’s no new knob created. Yes, i can use this script to get new knob :

Code:

a=newblur('Blur')
a.addKnob(nuke.Int_Knob('test','test'))


but this is not i prefer. I want to have my new Node class is ready with its new knob as i instantiate it. Since i get no error , it’s hard to find out what’s wrong. Can anyone help me out ? what is missing? any Pythonerzz pls?

thanx

No Responses to “how to create new class based on existing Node”

Post a Comment