Created
September 17, 2014 09:48
-
-
Save petfactory/643068ad5b8136149e40 to your computer and use it in GitHub Desktop.
Toggle a bool knob in nuke
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def set_bool_knob(name, all=True, value=None): | |
if all: | |
node_list = nuke.allNodes() | |
else: | |
node_list = nuke.selectedNodes() | |
for node in node_list: | |
if [k for k in node.knobs() if k == name]: | |
if value is None: | |
node[name].setValue(not node[name].value()) | |
elif value is False: | |
node[name].setValue(False) | |
elif value is True: | |
node[name].setValue(True) | |
set_bool_knob('useGPUIfAvailable', all=False) | |
set_bool_knob('useGPUIfAvailable', value=True) | |
set_bool_knob('useGPUIfAvailable', value=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment