Set keyframes in knobs with python
This example sets a knob to a defined value in all frames .
nuke.Root()[‘first_frame’].getValue() returns float whyever…
So thats the reason i put it in “int()”
1 2 3 4 5 6 7 8 9 10 11 12 |
x = nuke.toNode("YourNode") # get first an last frame from Script and convert them into integer first = int(nuke.Root()['first_frame'].getValue()) last = int(nuke.Root()['last_frame'].getValue()) x['knobname'].setAnimated(0) # set value in all frames for i in range(first,last): nuke.activeViewer().frameControl(i) x['knobname'].setValueAt(value,i) |
Create knobs with python Execute writenode via python