Group { name GM_Switch_Highlight tile_color 0xffff00ff label "\[if \{\[numvalue this.which_highlight] == 0\} \{return \[value this.zero_is]\} else \{return \[value this.one_is]\}]\nGroup: \[value group_n]\n\[knob tile_color \[ expr \{ \[value which_highlight]? 16711935 : 4294902015 \}]]\n" note_font "Bitstream Vera Sans Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold" note_font_size 13 selected true xpos 620 ypos 216 addUserKnob {20 User} addUserKnob {41 which_highlight l which T Switch1.which} addUserKnob {26 ""} addUserKnob {1 zero_is l "0 is"} zero_is "on script" addUserKnob {1 one_is l "1 is"} one_is "on precomp" addUserKnob {26 ""} addUserKnob {1 group_n l Group} group_n "Light passes" addUserKnob {26 ""} addUserKnob {22 control1 l "Set All 0" T "nodes_classes = \[\"Group\"]\n\nfor node in nuke.allNodes(group=nuke.root()):\n if node.Class() in nodes_classes:\n try:\n node\[\"which_highlight\"].setValue(False)\n except Exception:\n pass\n" +STARTLINE} addUserKnob {22 control2 l "Set All 1" -STARTLINE T "nodes_classes = \[\"Group\"]\n\nfor node in nuke.allNodes(group=nuke.root()):\n if node.Class() in nodes_classes:\n try:\n node\[\"which_highlight\"].setValue(True)\n except Exception:\n pass\n"} addUserKnob {26 ""} addUserKnob {22 setgroup0 l "Set same group 0" T "m = nuke.thisGroup()\nk = m.knob('group_n').getValue()\n\nnodes_classes = \[\"Group\"]\n\nfor node in nuke.allNodes(group=nuke.root()):\n if node.Class() in nodes_classes:\n try:\n if node\[\"group_n\"].getValue() == k:\n node\[\"which_highlight\"].setValue(False)\n else:\n pass \n except Exception:\n pass\n" +STARTLINE} addUserKnob {22 setgroup1 l "Set same group 1" -STARTLINE T "m = nuke.thisGroup()\nk = m.knob('group_n').getValue()\n\nnodes_classes = \[\"Group\"]\n\nfor node in nuke.allNodes(group=nuke.root()):\n if node.Class() in nodes_classes:\n try:\n if node\[\"group_n\"].getValue() == k:\n node\[\"which_highlight\"].setValue(True)\n else:\n pass \n except Exception:\n pass\n"} addUserKnob {26 ""} addUserKnob {22 tut l Tutorial t "Opens the relevant tutorial from my site in your browser. " T "import os\nimport sys\n\ntry:\n import subprocess\n def _run(cmd, shell, wait):\n opener = subprocess.Popen(cmd, shell=shell)\n if wait:\n opener.wait()\n return opener.pid\nexcept ImportError:\n import popen2\n def _run(cmd, shell, wait):\n opener = popen2.Popen3(cmd)\n if wait:\n opener.wait()\n return opener.pid\n\ndef _open(url, wait=0):\n if sys.platform == \"darwin\":\n cmd = \[\"open\", url]\n elif hasattr(os, \"startfile\"):\n return os.startfile(url)\n elif os.environ.has_key(\"KDE_FULL_SESSION\") or os.environ.has_key(\"KDE_MULTIHEAD\") or \\\n os.environ.has_key(\"GNOME_DESKTOP_SESSION_ID\") or os.environ.has_key(\"GNOME_KEYRING_SOCKET\"):\n cmd = \[\"xdg-open\", url]\n else:\n raise OSError, \"Desktop not supported.\"\n\n return _run(cmd, 0, wait)\n\n_open('https://www.gatimedia.co.uk/switch-highlight')\n" +STARTLINE} addUserKnob {26 ""} addUserKnob {26 TEXT l "" +STARTLINE T "1.02 version"} addUserKnob {26 HeadlineB l "" +STARTLINE T "GM_Switch_Highlight© by Attila Gasparetz"} } Input { inputs 0 name Input1 xpos 290 ypos 398 number 1 } Input { inputs 0 name Input0 xpos 510 ypos 398 } Switch { inputs 2 name Switch1 xpos 400 ypos 494 } Output { name Output1 xpos 400 ypos 590 } end_group