pathonPanels – procedure on button press problems

hey,

i just did a script using a pythonPanels interface.
all worked fine until i did a small chande in one procedure.
i am not able to use "nuke.toNode("xxx")" in a procedure that is called from the python panel.

here a script that demonstrates the problem.

-> create a Blur node named "Blur1" before starting it.

Code:

import nuke
import nukescripts
class testPanel(nukescripts.PythonPanel):
    def __init__(self):
        nukescripts.PythonPanel.__init__( self, "testPanel")
        self.forwardButton = nuke.PyScript_Knob(">>")
        self.forwardButton.setCommand("test()")   
        self.addKnob(self.forwardButton)
 
def test():
    b =nuke.toNode("Blur1")
    print "b is currently: ", b
 
tp = testPanel()
tp.showModal()


after you press the button in the new panel, you see the return value "None". that means the command nuke.toNode("Blur1") thinks that the node "Blur1" is unknown..
it works, if you call it without the pythonPanels interface.

cheers

alex

(nuke 6.0v1)

edit:
if you add:
print "check exist: ", nuke.exists("Blur1")
in the test procedure, you will get the result "False"
but if you add:
print nuke.allNodes()
you will see the node exists..

strange to me.

p.s.: using "knobChanged" inside the class declaration does the same.

No Responses to “pathonPanels – procedure on button press problems”

Post a Comment