Is this what you are looking for?
#########################################################
def toggleValueOfSelectedSwitchNode():
    if theSwitchNode['which'].value() == 0:
        theSwitchNode['which'].setValue('1')

    elif theSwitchNode['which'].value() == 1:
        theSwitchNode['which'].setValue('0')
if __name__ == '__main__':
    toggleValueOfSelectedSwitchNode()
#########################################################

There are a few tutorials on the Foundry site about how to add this kind of
function into the interface.

Hope this helps
Pete



On Mon, Sep 26, 2011 at 2:48 AM, Hugo Léveillé <[email protected]> wrote:

>  in menu.py
>
> nuke.menu('Nodes').addCommand('Merge/Switch','nuke.createNode("Switch")','s')
>
>  this would make "S" as the shortcut
>
>
>
>   On Sunday, September 25, 2011 2:45 PM, "Ron Ganbar" <[email protected]>
> wrote:
>
>  That would be with Python by recalling the switch command. I'm not in
> front of my computer. Anyone?
>
>
> Ron Ganbar
> email: [email protected]
> tel: +44 (0)7968 007 309 [UK]
>      +972 (0)54 255 9765 [Israel]
> url: http://ronganbar.wordpress.com/
>
>
>
>  On 25 September 2011 14:44, thim_vfx_newbie <
> [email protected]> wrote:
>
>  anybody's know.... how to create short cut for switch function in switch
> node?
>
> _______________________________________________
> 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 [email protected], 
> http://forums.thefoundry.co.uk/http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
>  --
>  Hugo Léveillé
>  TD Compositing, Vision Globale
>  [email protected]
>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>


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