Created
September 5, 2017 09:43
-
-
Save kpprt/17e3ab937478b29308bc55acc1fd2000 to your computer and use it in GitHub Desktop.
Small panel for Nuke to add a user knob to a selected node which is linked to a certain knob of another node. This basically works like the Pick Button, but for all nodes of the comp instead of just the containing nodes.
This file contains hidden or 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
# TODO: | |
# - convert label to proper knob name, e.g. w/o spaces | |
# - check if link expression is valid | |
# - implement a node and knob picker | |
if len(nuke.selectedNodes()) == 0: | |
nuke.message('no node selected') | |
else: | |
n = nuke.selectedNode() | |
p = nuke.Panel('Link Knob') | |
p.addSingleLineInput('label', '') | |
p.addSingleLineInput('link expression', '') | |
ret = p.show() | |
if ret: | |
label = p.value('label') | |
link_expression = p.value('link expression') | |
k = nuke.Link_Knob(label) | |
k.setLink(link_expression) | |
n.addKnob(k) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment