You could do it with a callback

def root_format_changer():
    n = nuke.thisNode()
    k = nuke.thisKnob()
    if not n.name() == "Switch1":
        return
    if k.value() == 0:
        nuke.root()['format'].setValue("HD")
    if k.value() == 1:
        nuke.root()['format'].setValue("NTSC")
nuke.addKnobChanged(root_format_changer,nodeClass = "Switch")


If you are not always sure that you switch is going to be named
Switch1, just test the callback on a hidden knob



On Fri, Apr 13, 2012, at 14:37, jaden wrote:

Hello folks,
I came across this problem and cant seem to hack it.
I basically want the root format to change between HD and 720p
when the Switch1.which value changes between 0 and 1.
i found out that the link menu doesnt accept either tcl nor
python and anything I tried didnt work Sad
does anybody has any pointers or has daone this before?
greets,
jaden

_______________________________________________

Nuke-python mailing list

[1][email protected],
[2]http://forums.thefoundry.co.uk/

[3]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-
python

References

1. mailto:[email protected]
2. http://forums.thefoundry.co.uk/
3. 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

Reply via email to