Nice !

i've tried your refreshPanel() function, it work fine, my knob
is refreshed, but i don't know why, when the function is executed the
current
Tab where the Knob is changed to another tab, as example
if your custom knobs is on a Read node when i execute refreshPanel
the focused Tab changed to the read node "Sequence"...

anyway... i've tried by adding just this in my code execution:

nuke.selectedNode()["the_knob"].setLabel("<img
src=\":qrc/images/Remove.png\">")
nuke.selectedNode()["the_knob"].clearFlag(0)

the .clearFlag(0) do the trick! the knob is refreshed !

thanks a lot for your help.

2011/3/23 John RA Benson <[email protected]>

> 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
>
>
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to