I am building a UI i.e. just the prompt if multiple read nodes exists in the selection.
which i will pass and populate in the PullDown_knob, uphill this part
everything is working fine, but when i want to set to different value i get
error message..
based on the read node selected from putdown i want to put the selected node in
the Text_knob above it.. have a look at the code i have written so far...
Code:
import nukescripts
import nuke
if nuke.env["gui"]:
class PromptName(nukescripts.PythonPanel):
def __init__(self, *args):
self.readNodeLst = args
nukescripts.PythonPanel.__init__( self, "Name for Backdrop",
"namePrompt" )
self.name = nuke.EvalString_Knob( "name", "Name:" )
self.readNodes = nuke.Pulldown_Knob("pulldown",'nodeNames',
self.retDict())
self.addKnob(self.name)
self.addKnob(self.readNodes)
#self.name.setValue("")
def retDict(self):
readNodeDict = {}
for eachReadNode in self.readNodeLst:
readNodeDict[eachReadNode] = self.setNameValue
return readNodeDict
# The next function shows the dialog as a modal dialog. Doing this
automatically adds the 'OK' and 'Cancel' buttons to the dialog.
def showModalDialog( self ):
result = nukescripts.PythonPanel.showModalDialog(self)
if result:
return self.name.value()
def setNameValue(self):
self.name.setValue(self.readNodes.value())
# The following function is called testModalPanel and tests whether the dialog
works.
def testModalPanel():
obj = PromptName("Hello","Hello2")
obj.showModalDialog()
#return PromptName().showModalDialog("Hello")
# This last line calls the test function that then displays the dialog.
testModalPanel()
when selection is changed i get error saying
File "<string>", line 1
<bound method PromptName.setNameValue of <backDropName>>
^
SyntaxError: invalid syntax
also i can i make a default item in Pulldown_knob?
------------------------
san
<<attachment: Screen Shot 2013-06-16 at 6.33.01 PM.png>>
_______________________________________________ Nuke-python mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
