-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnukestartup.py
38 lines (29 loc) · 1.3 KB
/
nukestartup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import sys
import nuke
# Init the script by running nuke.scriptOpen(slatemachine.nk) by looking at the launch flags
inScript = sys.argv[4]
nuke.scriptOpen(inScript)
print("---")
print(sys.argv)
# Set values from ingest.py passed along by -t on launch
nukeinputclean = str(sys.argv[1])
lastframe = int(sys.argv[2])
currentcolorfileclean = str(sys.argv[3])
nuke.toNode("renderInput").knob("file").setValue(nukeinputclean)
nuke.toNode("renderInput").knob("last").setValue(lastframe)
nuke.toNode("OCIOCDLTransform1").knob("file").setValue(currentcolorfileclean)
# Execute the global frame length setup button in SlateMachine
nuke.toNode("SlateMachine1").knob("setprojframes").execute()
print(currentcolorfileclean)
# Save the script
nuke.scriptSaveAs(nuke.script_directory() + "/slatemachine.nk", 1)
# Render the script and quit on render complete
nuke.render(nuke.toNode("slatemachineOutputPlate"))
# Disable the plate write node and enable the regular one, reset some SlateMachine1 values
nuke.toNode("slatemachineOutputPlate")['disable'].setValue(0)
nuke.toNode("slatemachineOutput")['disable'].setValue(1)
nuke.toNode("SlateMachine1").knob("task").setValue("")
nuke.toNode("SlateMachine1").knob("completion").setValue("100%")
# Save the script again!
nuke.scriptSaveAs(nuke.script_directory() + "/slatemachine.nk", 1)
quit()