There are a few ways you could approach this problem, depending on how 
technical you want to get.

1) Simply add an explicit call to your function in each gizmo’s 'autolabel' 
knob.

    g['autolabel'].setValue('myFunction()')

2) If your gizmos use a standard naming convention (which it looks like they 
may), write your own addGizmoAutolabel function that wraps nuke.addAutolabel 
and matches un-versioned gizmo classes. So you would pass in 'Splitter' as the 
class and it would check nuke.plugins for gizmos matching a regexp that fits 
your naming convention and add the autolabel callback to each one.

3) Write a more comprehensive gizmo manager class that manages your entire 
collection of gizmos, including menu item creation, version priority, callback 
registration (using partially- or fully-qualified class names), etc.

-Nathan



From: Matthieu Cadet 
Sent: Tuesday, January 24, 2012 12:50 AM
To: Nuke Python discussion 
Subject: Re: [Nuke-python] nuke.addAutolabel on Gizmo node class

Yes that's right, but the thing is i'm using lot of gizmos and all gizmos have 
version number include in the filename, 
so if i have for example one gizmo "Splitter_v01.gizmo"; "Splitter_v02.gizmo" ; 
"Splitter_v03.gizmo"; ... 
then each gizmo class name will be  Splitter_v01; Splitter_v02;Splitter_v03;...

and if i want to put a custom label on all of my gizmo the only way is to put 
nuke.addAutolabel for each version of my gizmos like this :

nuke.addAutolabel(myFunction,nodeClass="Splitter_v01") 
nuke.addAutolabel(myFunction,nodeClass="Splitter_v02") 
nuke.addAutolabel(myFunction,nodeClass="Splitter_v03") 
nuke.addAutolabel(myFunction,nodeClass="Stereo_v01") 
nuke.addAutolabel(myFunction,nodeClass="Stereo_v02") 
etc...

i was wondering if there is a node class name that represent all kind of gizmo.

i will ask Nuke support for this, thanks for your help ;)

On Mon, Jan 23, 2012 at 5:18 PM, Nathan Rusch <[email protected]> wrote:

  A gizmo's "class" is simply the base name of the .gizmo file you export.

  So if I have a gizmo called "MySpecialDespill.gizmo," the class is 
"MySpecialDespill."


------------------------------------------------------------------------------
  From: [email protected]
  Date: Mon, 23 Jan 2012 14:46:09 +0100
  To: [email protected]
  Subject: [Nuke-python] nuke.addAutolabel on Gizmo node class 


  Hi! 

  Does anyone know if it's possible to use the "nuke.addAutolabel" callback 
function on only "Gizmo" node class ?
  like this for example :

  nuke.addAutolabel(myFunction,nodeClass="Gizmo")

  but it seems that "Gizmo" node cannot be specified as nodeClass argument in 
nuke.addAutolabel ...

  thanks for your help ;)

  -- 
  Matthieu Cadet
  Compositor Artist & TD, 
  nWave Digital
  [email protected]


  _______________________________________________ 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






-- 
Matthieu Cadet
Compositor Artist & TD, 
nWave Digital
[email protected]



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