calling flipbook function from custom panel

hi, i create my panel , it’s very simple panel with only one button, this button suppose to do the flipbook, here’s the code :

Code:

from nukescripts.panels import PythonPanel
class test(PythonPanel) :
  def __init__(self,title,id):
    PythonPanel.__init__(self,title,id)
    self.but=nuke.PyScript_Knob('button','button')
    self.addKnob(self.but)
  def knobChanged(self,knob):
    self.flip()
  def flip(self):
    nukescripts.flipbook(nukescripts.framecycler_this, nuke.selectedNode(), ("1,5", ["main"]) )


then instantiate the panel using :

Code:

m=test('testpanel','123')
m.show()


select any node to render (in my example i select a Colorbar Node) ,then press the button, i got bunch of error messg, the last line said :
ValueError: ColorBars1.first_frame cannot be turned into a number

the script is working fine, as i tested on script editor without problem, the code below is working perfectly :

Code:

m.flip()


So the problem i cannot call the ‘nukescripts.flipbook()’ function by using the panel. Anyone got the solution?

thanx

No Responses to “calling flipbook function from custom panel”

Post a Comment