I want to use PyQt in Nuke to create custom panel but confused about the nuke.addKnobChanged() callback command.Currently I can't excute custom function as a argument in this command to do an action.When run the script,an error rises. Anyone can help me to figure out the issue?Thanks in advance.
I paste the codes and relative function docs here:
import nuke import nukescripts import string from PyQt4.QtGui import * from PyQt4.QtCore import * from nukescripts import panels class colorwheelBrowserWidget(QWidget): def __init__(self): #super( QWidget, self).__init__() QWidget.__init__(self) self.master_Taggle= QPushButton(self) self.master_Taggle.setObjectName( "master" ) self.master_Taggle.setGeometry(QRect(0, 0, 150, 40)) self.master_Taggle.setText(" master ") def Print_Button_name (): a=colorwheelBrowserWidget().master_Taggle b=a.objectName() k = nuke.thisKnob() if k.name() == "gamma": nuke.tprint( nuke.addKnobChanged( Print_Button_name ,nodeClass="ColorCorrect")
###
console output error info:
wrapped C/C++ of type QPushButton has been deleted
addKnobChanged docs:
addKnobChanged(call, args=(), kwargs={}, nodeClass='*', node=None) Add code to execute when the user changes a knob The knob is availble in nuke.thisKnob() and the node in nuke.thisNode(). This is also called with dummy knobs when the control panel is opened or when the inputs to the node changes. The purpose is to update other knobs in the control panel. Use addUpdateUI() for changes that should happen even when the panel is closed.