Thumbnail for Scanline Render Simple

Gizmo

Scanline Render Simple

A wrapper around the default Nuke scanline render node. Adds support setting parameters for GUI and Non-GUI renders as well as proxy modes and super sampling.

ToolSets/3d/scanlineRenderAdvanced.nk
1set cut_paste_input [stack 0]
2version 12.1 v4
3push $cut_paste_input
4Group {
5 name scanlineRenderAdvanced
6 onCreate "import nuke\n\n#zz = nuke.FrameRange('100-200')\n#print zz.frames()\n\nff = nuke.Root().firstFrame()\nlf = nuke.Root().lastFrame()\n\nnuke.thisNode().knob('fr').setValue('\{\}-\{\}'.format(ff, lf))\n\n\n\n"
7 tile_color 0x421010ff
8 label "\[value gui_samples] : \[value render_samples] - \[value overscan_dynamic]"
9 addUserKnob {20 User l ScanlineRender}
10 addUserKnob {41 format T Constant1.format}
11 addUserKnob {1 fr l "frame range" -STARTLINE}
12 fr 1-100
13 addUserKnob {41 overscan_dynamic l overscan T ScanlineRender1.overscan_dynamic}
14 addUserKnob {41 filter l "sample filter" T ScanlineRender1.filter}
15 addUserKnob {41 antialiasing -STARTLINE T ScanlineRender1.antialiasing}
16 addUserKnob {41 zblend_mode l "Z-blend mode" -STARTLINE T ScanlineRender1.zblend_mode}
17 addUserKnob {41 shutter T ScanlineRender1.shutter}
18 addUserKnob {41 gui_samples l "gui samples" T ScanlineRender1.gui_samples}
19 addUserKnob {7 gui_scale l "gui scale" -STARTLINE R 0.1 1}
20 gui_scale 1
21 addUserKnob {41 render_samples l "render samples" T ScanlineRender1.render_samples}
22 addUserKnob {7 render_scale l "render scale" -STARTLINE R 1 10}
23 render_scale 1
24 addUserKnob {41 filter_1 l "uprez filter" T Reformat2.filter}
25 addUserKnob {41 expand l "deep soft expand" T DeepExpression1.expand}
26 addUserKnob {26 ""}
27 addUserKnob {26 lbl l "" t "July 12, 2019- added overscan\nJuly 19, 2019 - added soft deep and dynamic scale 1.2\nJuly 24, 2019 - added deep proxy scale 1.3" +STARTLINE T "ScanlineRender Advanced v1.3"}
28 addUserKnob {22 btn l DerekVFX.ca T "nuke.tcl('start', 'https://derekvfx.ca')" +STARTLINE}
29 addUserKnob {20 aov l AOV}
30 addUserKnob {41 output_shader_vectors l "output vectors" T ScanlineRender1.output_shader_vectors}
31 addUserKnob {41 P_channel l "surface point" T ScanlineRender1.P_channel}
32 addUserKnob {41 N_channel l "surface normal" T ScanlineRender1.N_channel}
33}
34 Constant {
35 inputs 0
36 name Constant1
37 xpos 684
38 ypos 245
39 }
40set Ndd11400 [stack 0]
41 Dot {
42 name Dot5
43 note_font_size 40
44 xpos 888
45 ypos 272
46 }
47 Dot {
48 name Dot4
49 note_font_size 40
50 xpos 888
51 ypos 741
52 }
53 Input {
54 inputs 0
55 name deepHoldout
56 xpos 84
57 ypos 245
58 number 2
59 }
60 DeepReformat {
61 format {{{parent.Constant1.format}}}
62 resize none
63 pbb true
64 name DeepReformat1
65 xpos 84
66 ypos 271
67 }
68set Ndd10400 [stack 0]
69 DeepReformat {
70 type scale
71 scale {{parent.guiScale.scale}}
72 pbb true
73 name deepReformatGUI
74 xpos -41
75 ypos 346
76 }
77push $Ndd10400
78 DeepReformat {
79 type scale
80 scale {{parent.renderScale.scale}}
81 pbb true
82 name deepReformatRender
83 xpos 84
84 ypos 346
85 }
86 Switch {
87 inputs 2
88 which {{"\$gui"}}
89 name Switch1
90 label "\[value which]"
91 xpos 84
92 ypos 412
93 }
94 set Cdd37800 [stack 0]
95 Dot {
96 name Dot3
97 note_font_size 40
98 xpos 118
99 ypos 611
100 }
101 Input {
102 inputs 0
103 name cam
104 xpos 284
105 ypos 245
106 number 1
107 }
108 Dot {
109 name Dot2
110 note_font_size 40
111 xpos 318
112 ypos 502
113 }
114 Input {
115 inputs 0
116 name scene
117 xpos 484
118 ypos 245
119 }
120push $Ndd11400
121 Reformat {
122 type scale
123 scale {{gui_scale}}
124 name guiScale
125 xpos 559
126 ypos 346
127 }
128push $Ndd11400
129 Reformat {
130 type scale
131 scale {{render_scale}}
132 name renderScale
133 xpos 684
134 ypos 346
135 }
136clone $Cdd37800 {
137 inputs 2
138 xpos 684
139 ypos 412
140 selected false
141 }
142 Dot {
143 name Dot1
144 note_font_size 40
145 xpos 718
146 ypos 502
147 }
148 ScanlineRender {
149 inputs 3
150 conservative_shader_sampling false
151 antialiasing high
152 overscan {{"\$gui ? overscan_dynamic*guiScale.scale : overscan_dynamic*renderScale.scale"}}
153 samples {{"\$gui ? gui_samples : render_samples"}}
154 shutteroffset centred
155 motion_vectors_type distance
156 name ScanlineRender1
157 label "\[value samples]"
158 xpos 484
159 ypos 492
160 addUserKnob {20 User}
161 addUserKnob {3 gui_samples}
162 gui_samples 1
163 addUserKnob {3 render_samples}
164 render_samples 5
165 addUserKnob {7 overscan_dynamic R 0 100}
166 overscan_dynamic 32.8
167 }
168 DeepExpression {
169 chans1 deep
170 deep.front "deep.front - \[value expand]"
171 deep.back "deep.back + \[value expand]"
172 name DeepExpression1
173 xpos 484
174 ypos 551
175 disable {{"expand == 0"}}
176 addUserKnob {20 User}
177 addUserKnob {7 expand R 0 100}
178 expand 30.4
179 }
180 DeepHoldout2 {
181 inputs 2
182 name DeepHoldout1
183 xpos 484
184 ypos 607
185 }
186 Reformat {
187 format {{{parent.Constant1.format}}}
188 pbb true
189 name Reformat2
190 xpos 484
191 ypos 676
192 }
193 Switch {
194 inputs 2
195 name Switch2
196 xpos 484
197 ypos 737
198 disable true
199 }
200 Output {
201 name Output1
202 xpos 484
203 ypos 785
204 }
205end_group
206