Home Page › forums › fx Art and Technique › Expressions for VFX › nuke python : how to update nuke.frame()
- This topic has 0 replies, 1 voice, and was last updated 10 years, 1 month ago by metaclay_vb.
-
AuthorPosts
-
September 8, 2010 at 3:34 am #203776metaclay_vbParticipant
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
-
AuthorPosts
- You must be logged in to reply to this topic.
