nuke python : how to update nuke.frame()

Home Page forums fx Art and Technique Expressions for VFX nuke python : how to update nuke.frame()

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #203776
    metaclay_vb
    Participant

    Hi any expert nuke scripterz here? i need help 🙂
    i create this code , showing panel and a single button, so when button pressed i want to simply get the current frame number. Here’s the code :

    from nukescripts.panels import PythonPanel

    class mypanel(PythonPanel):
    def __init__(self):
    PythonPanel.__init__(self,”test panel”,”uk.co.thefoundry.FramePanel”)
    self.curbutton=nuke.PyScript_Knob(“curbutton”,”Get Current Frame”)
    self.addKnob(self.curbutton)

    def showmsg(self):
    f=nuke.frame()
    msg = ‘Current frame is ‘ +str(f)
    nuke.message(msg)

    def knobChanged(self,knob):
    if knob== self.curbutton :
    self.showmsg()

    p=mypanel()
    p.show()[/CODE]

    The problem is : if i change current frame slider, then press the button. It won’t update untill i restart the panel. So while the panel is still open , it won’t update the nuke.frame() value . i have to ‘kill’ the panel to refresh the value ??

    Thanx[CODE]from nukescripts.panels import PythonPanel

    class mypanel(PythonPanel):
    def __init__(self):
    PythonPanel.__init__(self,”test panel”,”uk.co.thefoundry.FramePanel”)
    self.curbutton=nuke.PyScript_Knob(“curbutton”,”Get Current Frame”)
    self.addKnob(self.curbutton)

    def showmsg(self):
    f=nuke.frame()
    msg = ‘Current frame is ‘ +str(f)
    nuke.message(msg)

    def knobChanged(self,knob):
    if knob== self.curbutton :
    self.showmsg()

    p=mypanel()
    p.show()[/CODE]

    The problem is : if i change current frame slider, then press the button. It won’t update untill i restart the panel. So while the panel is still open , it won’t update the nuke.frame() value . i have to ‘kill’ the panel to refresh the value ??

    Thanx

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Copy link
Powered by Social Snap