Just wrap the FrameHold in a simple gizmo.

-Nathan



From: jedypod 
Sent: Saturday, April 28, 2012 11:01 AM
To: [email protected] 
Subject: [Nuke-python] Re: Adding Knobs to a Node on certain Tab

Thanks for the technique! I actually figured out another way to do it, which is 
using the addOnUserCreate callback. It seems a little simpler, since you don't 
have to replace the node with a modified one, you just add knobs whenever the 
node is created. This method does the same thing, where the FrameHold node's 
'first_frame' knob is just set to the current frame, but I was thinking it 
would be useful to have a button to set it to a different frame, in case things 
changed! Something like this:

      Code:  

      # Sets default frame of the FrameHold node to be the current frame 
position
      def custom_framehold():
          fh = nuke.thisNode()
          fh.knob('first_frame').setValue(nuke.frame())
          tab = nuke.Tab_Knob('Set', 'Set')
          btn = nuke.PyScript_Knob("Set_BTN", "Set To Current Frame")
          fh.addKnob(tab)
          fh.addKnob(btn)
          fh['Set_BTN'].setCommand("fh = 
nuke.thisNode()\nfh.knob('first_frame').setValue(nuke.frame())")
      nuke.addOnUserCreate(custom_framehold, nodeClass="FrameHold")
     


I was just wondering if there was a way to put the button in the main tab 
somehow.


--------------------------------------------------------------------------------
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to