i use a little snippet:
def refreshPanel(node):
"""refreshPanel(node) -> hack: required to update button names in the
properties panel
"""
node.knob(node.knob('knobChanged').value()).clearFlag(0)
So after you do your setLabel, just run 'refreshPanel(nuke.selectedNode)'.
Basically, I think you just need to do something to force the panel to change,
but don't really change anything.
JRAB
On Mar 23, 2011, at 4:15 PM, Matthieu Cadet wrote:
> Hi !
>
> I'm currently trying to change the label of knob ( label icon to be precise,
> with as example this value <img src=":qrc/images/FolderIcon.png"> )
> but i want to be able to change this label value for changing the knob icon.
>
> Here the basic code of what i'm doing :
>
> i set first the icon:
> nuke.selectedNode()["the_knob"].setLabel("<img
> src=\":qrc/images/Add.png\">")
>
> then i change it to another icon:
> nuke.selectedNode()["the_knob"].setLabel("<img
> src=\":qrc/images/Remove.png\">")
>
>
> This work fine but i don't see the changes until i'm closing the Node panel
> properties and reopen it, then i see the change.
>
> But i was wondering if there is a special knob command to refresh it in the
> UI or propertie panel...
>
>
> Thanks for your help guys !
>
> ----
> Matthieu
> _______________________________________________
> Nuke-python mailing list
> [email protected]
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python