Having tons of frame buffers in Nuke is great but the viewer nodes' input pipes can get quite messy so here is a proc to toggle their visibility on and off.
proc HideViewerInputs {} {
#loop through all nodes in the script
foreach cur_node [nodes] {
#if you find a node that is a viewer node...
if {[class $cur_node] == "Viewer"} {
#use the inverse of it's current knob "hide_input" as the new value
knob $cur_node.hide_input !$cur_node.hide_input
}
}
}
I assigned "shift+enter" as the hotkey for this so in your menu.tcl you can do something like this:
menu "Other/hide viewer inputs" "shift+0xFF0D" HideViewerInputs .