nuke.callbacks.updateUI() will only trigger registered callbacks; as far as I know, the `updateUI` knob’s contents are executed directly by C++ code in DDImage or Nuke.
-Nathan From: Howard Jones Sent: Wednesday, April 17, 2013 5:56 AM To: Nuke Python discussion Subject: Re: [Nuke-python] UpdateUi Do I just run that for an update, as if I try and run it in the script Editor it doesn't trigger the knob updateUI. Below is the node I am attempting to get to update reliably. It WILL update but often it's missed. It's the 'channelShuffler' node inside the VIEWER_INPUT group. An alternative could be to check what the viewer is attached to but I haven't figured that one out yet. Cheers Howard set cut_paste_input [stack 0] version 7.0 v6 push $cut_paste_input Group { name VIEWER_INPUT updateUI "\nn=nuke.toNode('VIEWER_INPUT.ChannelShuffler')\nnuke.root().begin()\ni = nuke.selectedNode()\nnuke.root().end()\nnuke.message('update triggered')\n\nif not i\['channels'].value() in ('all', 'none') :\n try:\n ch= i\['channels'].value()\n n\['in'].setValue(ch)\n except:\n n\['in'].setValue('rgba')\nelse:\n n\['in'].setValue('rgba')\n" selected true xpos -256 ypos 199 addUserKnob {20 User} addUserKnob {6 updateMe l update +STARTLINE} } Input { inputs 0 name Input1 xpos -318 ypos 342 } set Nc6bf880 [stack 0] Text { output rgb replace true message "channel \[value ChannelShuffler.in]" font /Library/Fonts/Arial.ttf yjustify bottom Transform 1 box {0 0 {width} 100} center {960 540} name ChannelText1 xpos -400 ypos 429 } push $Nc6bf880 add_layer {CW CW.red CW.green CW.blue CW.alpha} Shuffle { in CW name ChannelShuffler updateUI "\nn=nuke.toNode('VIEWER_INPUT.ChannelShuffler')\nnuke.root().begin()\ni = nuke.selectedNode()\nnuke.root().end()\nnuke.message('update triggered')\n\nif not i\['channels'].value() in ('all', 'none') :\n try:\n ch= i\['channels'].value()\n n\['in'].setValue(ch)\n except:\n n\['in'].setValue('rgba')\nelse:\n n\['in'].setValue('rgba')\n" label "\[value in] > \[value out]\n" xpos -318 ypos 399 } Merge2 { inputs 2 operation exclusion also_merge all name Merge2 xpos -318 ypos 487 } Output { name Output1 xpos -318 ypos 580 } end_group ------------------------------------------------------------------------------ From: Nathan Rusch <nathan_ru...@hotmail.com> To: Nuke Python discussion <nuke-python@support.thefoundry.co.uk> Sent: Tuesday, 16 April 2013, 17:56 Subject: Re: [Nuke-python] UpdateUi Is nuke.callbacks.updateUI() not what you want? -Nathan -----Original Message----- From: Howard Jones Sent: Tuesday, April 16, 2013 1:33 AM To: Nuke Python discussion Subject: [Nuke-python] UpdateUi I'm looking at using updateUI callback to update a node so that it auto shuffles into RGB the currently selected node where possible. This is all working ok, except as the manual points out updateUI is a low level callback and seems hard to reliably trigger. Is there something that can be run to force an update reliably? I can understand why that may not be a good idea mind. Howard_______________________________________________ Nuke-python mailing list Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python _______________________________________________ Nuke-python mailing list Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python -------------------------------------------------------------------------------- _______________________________________________ Nuke-python mailing list Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________ Nuke-python mailing list Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python