It would actually be dead simple to add an onCreate callback that would add a tab with a custom name, and then add the button to it (obviously only if those controls didn't already exist). That way your node-related controls stay on the node, instead of the user having to associate a menu item with a very node-centric action.

---------------------------------------
def onCreateGroupWrapper():
   g = nuke.thisNode()
   if g.knob('tab_myCustomTabName') is None:
       g.addKnob(nuke.Tab_Knob('tab_myCustomTabName', 'Custom Tab Title'))
g.addKnob(nuke.PyScript_Knob('customScriptButton', 'Custom Script Button...', 'nuke.message("Custom script button clicked")'))

nuke.addOnCreate(onCreateGroupWrapper, nodeClass='Group')
---------------------------------------

That's a general idea at least... you'll have to forgive any syntax errors, as I'm trying this directly into the emal.

-Nathan

-----Original Message----- From: Olivier Jezequel
Sent: Thursday, October 20, 2011 9:14 AM
To: [email protected]
Subject: Re: [Nuke-python] Re: Having custom python run when 'Save as Gizmo'button clicked

I was thinking at something more simple.
You have a menu calling your function. You just select your group and
click on your menu.
No need to trouble yourself with adding extra button everywhere

coreydrake wrote:
Hm, interesting thoughts, thank you guys. That gets some ideas going. Olivier, would it be difficult/possible to have all group nodes have an extra button by default next to the save as gizmo button that could run my custom function?
------------------------------------------------------------------------

_______________________________________________
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
_______________________________________________
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