Last active
May 20, 2024 20:31
-
-
Save fredrikaverpil/9760964 to your computer and use it in GitHub Desktop.
Get and set knob values #nuke
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
# Get all nodes of type Read | |
readnodes = nuke.allNodes('Read') | |
for readnode in readnodes: | |
print readnode | |
# List all knobs for selected node | |
print( nuke.toNode('Read1') ) | |
# List all knobs for specific node | |
print( nuke.selectedNode() ) | |
# Get value from specific node | |
value = nuke.toNode('Read1').knob('file').getValue() | |
# Get value from selected node | |
value = nuke.selectedNode().knob('file').getValue() | |
# Get value from this node | |
value = nuke.thisNode().knob('file').getValue() | |
# Get value from specific node and evaluate it (good for expressions) | |
value = nuke.toNode('Read1').knob('file').evaluate() | |
# Set specific node's value | |
nuke.toNode('Read1').knob('file').setValue('c:/hello.tif') | |
# Set selected node's value | |
nuke.selectedNode().knob('file').setValue('c:/hello.tif') | |
# Set this node's value | |
nuke.thisNode().knob('file').setValue('c:/hello.tif') | |
# Set specific node's knob to default value | |
nuke.toNode('Grade1').knob('gamma').setValue( nuke.toNode('Grade1').knob('gamma').defaultValue() ) |
so the problem is its not working when i set #folder by expression link it giving error like this:
# Result: Traceback (most recent call last):
File "<string>", line 4, in <module>
TypeError: 'bool' object is not iterable
- so i tried to print folder value as string to an other variable but it didnt work
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi i'd like to make auto path finder for my render footages and trust me there is allot of sequence.
there is the code:
so this code is working but i want to be like this: