The 'autolabel' knob is like the 'knobChanged' knob, in that it is meant to
store Python code to be evaluated as part of the autolabel process. I believe
the knob is evaluated first (if it is not empty), so code in there that returns
a not-None label will take precedence over any registered callback functions.
-Nathan
From: Michael Garrett
Sent: Thursday, May 02, 2013 2:35 PM
To: Nuke Python discussion
Subject: Re: [Nuke-python] autoLabel is replacing name in dag
Ah, thanks Nathan - I thought addAutoLabel() would only change the 'autolabel'
hidden knob.
Googling some examples, this works better:
def AL():
n=nuke.thisNode()
label= '%s\n %s' %(n.name(), n['size'].value())
return label
nuke.addAutolabel(AL, nodeClass='Blur')
On 2 May 2013 16:44, Nathan Rusch <[email protected]> wrote:
The behavior you’re seeing sounds like it’s in line with the intended
callback behavior:
"...If all of [the registered callbacks] return None, then
nuke.thisNode().name() is used"
-Nathan
From: Michael Garrett
Sent: Thursday, May 02, 2013 1:38 PM
To: Nuke Python discussion
Subject: [Nuke-python] autoLabel is replacing name in dag
I'm finding that an autoLabel is replacing the node name in the dag, for
example:
def AL():
blurSize=nuke.thisNode()['size'].value()
return blurSize
nuke.addAutolabel(AL, nodeClass='Blur')
...then create a Blur node.
I'm on Windows 7, Nuke 7.0v5.
Thanks,
Michael
------------------------------------------------------------------------------
_______________________________________________
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
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python