Group { name GM_Render_Switch tile_color 0xbbbbbbff selected true xpos 400 ypos 230 addUserKnob {20 User} addUserKnob {26 info1 l "Switch this node"} addUserKnob {6 r_s_tick l "Show 1" +STARTLINE} addUserKnob {26 info2 l "Switch all nodes"} 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\[\"r_s_tick\"].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\[\"r_s_tick\"].setValue(True)\n except Exception:\n pass\n"} addUserKnob {26 ""} addUserKnob {26 info3 l "" +STARTLINE T "Recommended use:\n0 - Lighter nodes\n1 - Heavy nodes\n-------------------------\nThe nodes on 1 will be\n used in rendering."} addUserKnob {26 ""} addUserKnob {22 tut l Tutorial t "Opens the relevant tutorial from my site in your browser. " -STARTLINE 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/render-switch')\n"} addUserKnob {26 ""} addUserKnob {26 TEXT l "" +STARTLINE T "1.01 version"} addUserKnob {26 credit l "" +STARTLINE T "GM_Render Switch© by Attila Gasparetz and Nicholas Zissimos - 2019"} } Input { inputs 0 name Input1 xpos 400 ypos 494 number 1 } set N8fd94380 [stack 0] Input { inputs 0 name Input0 xpos 620 ypos 494 } Switch { inputs 2 which {{"\[python nuke.executing()]"}} name Switch1 label "\[value which]" xpos 620 ypos 632 } set N8fd94000 [stack 0] push $N8fd94380 push $N8fd94000 Switch { inputs 2 which {{parent.r_s_tick}} name Switch2 label "\[value which]" xpos 400 ypos 632 } Switch { inputs 2 which {{"\[python nuke.executing()]"}} name Switch3 label "\[value which]" xpos 400 ypos 728 } Output { name Output1 xpos 400 ypos 830 } end_group