Benyee Posted May 16, 2014 Share Posted May 16, 2014 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 nukeimport nukescriptsimport stringfrom PyQt4.QtGui import *from PyQt4.QtCore import *from nukescripts import panelsclass 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 isavailble 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.