Jump to content

Nuke Custom Interface Issue


Benyee

Recommended Posts

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(B)
  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.

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...