Particle box for Nuke
Particle box for Nuke
1set cut_paste_input [stack 0]
2version 11.1 v3
3push $cut_paste_input
4Group {
5 name waterSchmutz
6 tile_color 0x421010ff
7 selected true
8 xpos 8204
9 ypos 1091
10 addUserKnob {20 User l waterSchmutz}
11 addUserKnob {41 cube l boundaries T Cube1.cube}
12 addUserKnob {26 ""}
13 addUserKnob {41 translate T Cube1.translate}
14 addUserKnob {41 rotate T Cube1.rotate}
15 addUserKnob {26 ""}
16 addUserKnob {6 spriteView +STARTLINE}
17 addUserKnob {6 customSpriteSwitch l "custom sprite" -STARTLINE}
18 addUserKnob {41 start_frame l "start at" T ParticleEmitter3.start_frame}
19 addUserKnob {7 particleDensity l "particle density"}
20 particleDensity 1
21 addUserKnob {41 size T ParticleEmitter3.size}
22 addUserKnob {41 size_variation l "size range" T ParticleEmitter3.size_variation}
23 addUserKnob {22 update l "Refresh Particles" T "import random\nnuke.thisNode().knob('seed').setValue( random.randint(1,16384) )" +STARTLINE}
24 addUserKnob {3 seed -STARTLINE}
25 seed 4191
26 addUserKnob {41 to l "wind direction" T ParticleWind1.to}
27 addUserKnob {6 wrapPart l "wrap particles" +STARTLINE}
28 wrapPart true
29 addUserKnob {7 edgefade l "edge fade"}
30 edgefade 0.4
31 addUserKnob {26 ""}
32 addUserKnob {7 tScale l "turbulence scale" R 0 10}
33 tScale 8
34 addUserKnob {7 tStrength l "turbulence stregth"}
35 tStrength 1
36 addUserKnob {26 ""}
37 addUserKnob {26 lbl l "" +STARTLINE T "waterSchmutz v1.5"}
38 addUserKnob {22 btn l DerekVFX.ca T "nuke.tcl('start', 'https://derekvfx.ca')" +STARTLINE}
39 addUserKnob {20 render l renderSettings}
40 addUserKnob {41 format l "output format" T Reformat3.format}
41 addUserKnob {41 antialiasing T ScanlineRender1.antialiasing}
42 addUserKnob {41 overscan T ScanlineRender1.overscan}
43 addUserKnob {6 proxyRender l "proxy mode" +STARTLINE}
44 proxyRender true
45 addUserKnob {6 guiDisable l "GUI Disable" +STARTLINE}
46 addUserKnob {26 ""}
47 addUserKnob {41 samples T ScanlineRender1.samples}
48 addUserKnob {41 shutter T ScanlineRender1.shutter}
49 addUserKnob {41 stochastic_samples l "stochastic samples" T ScanlineRender1.stochastic_samples}
50 addUserKnob {20 particleSettings}
51 addUserKnob {41 format_1 l format T Constant1.format}
52 addUserKnob {41 first l "frame range" T Constant1.first}
53 addUserKnob {41 last l "" -STARTLINE T Constant1.last}
54 addUserKnob {41 start_frame_animation l "start at" T ParticleEmitter3.start_frame_animation}
55 addUserKnob {41 start_wrap l "limit to range" -STARTLINE T ParticleEmitter3.start_wrap}
56 addUserKnob {41 frame_advance l advance T ParticleEmitter3.frame_advance}
57 addUserKnob {41 max_clip_length l "max clip length" -STARTLINE T ParticleEmitter3.max_clip_length}
58 addUserKnob {26 div l "" +STARTLINE T " "}
59 addUserKnob {20 spriteSettings n 1}
60 addUserKnob {41 type T Noise1.type}
61 addUserKnob {41 size_1 l x/ysize T Noise1.size}
62 addUserKnob {41 zoffset l z T Noise1.zoffset}
63 addUserKnob {41 gain T Noise1.gain}
64 addUserKnob {20 endGroup n -1}
65}
66 Cube {
67 inputs 0
68 display wireframe
69 render_mode wireframe
70 rows 1
71 columns 1
72 cube {-500 0 -500 500 500 500}
73 pivot {{"abs(cube.x-cube.r)/2+((cube.x<cube.r) ? cube.x : cube.r)"} {"abs(cube.y-cube.t)/2+((cube.y<cube.t) ? cube.y : cube.t)"} {"abs(cube.n-cube.f)/2+((cube.n<cube.f) ? cube.n : cube.f)"}}
74 name Cube1
75 tile_color 0xffcc00ff
76 gl_color 0xff3b00ff
77 xpos -870
78 ypos 484
79 hide_input true
80 addUserKnob {20 User}
81 addUserKnob {7 volume}
82 volume {{abs(cube.x-cube.r)*abs(cube.y-cube.t)*abs(cube.n-cube.f)}}
83 }
84 Input {
85 inputs 0
86 name customSprite
87 xpos -879
88 ypos 210
89 }
90 Reformat {
91 format {{{parent.Constant1.format}}}
92 resize distort
93 name Reformat1
94 xpos -879
95 ypos 313
96 }
97 Constant {
98 inputs 0
99 channels rgb
100 format "128 128 0 0 128 128 1 texture"
101 last 100
102 name Constant1
103 xpos -714
104 ypos 8
105 }
106 Noise {
107 size 82
108 zoffset 3.12
109 gain 0.57
110 center {1024 576}
111 name Noise1
112 xpos -714
113 ypos 135
114 }
115 Roto {
116 output alpha
117 replace true
118 curves {{{v x3f99999a}
119 {f 0}
120 {n
121 {layer Root
122 {f 2097152}
123 {t x44800000 x44100000}
124 {a pt1x 0 pt1y 0 pt2x 0 pt2y 0 pt3x 0 pt3y 0 pt4x 0 pt4y 0 ptex00 0 ptex01 0 ptex02 0 ptex03 0 ptex10 0 ptex11 0 ptex12 0 ptex13 0 ptex20 0 ptex21 0 ptex22 0 ptex23 0 ptex30 0 ptex31 0 ptex32 0 ptex33 0 ptof1x 0 ptof1y 0 ptof2x 0 ptof2y 0 ptof3x 0 ptof3y 0 ptof4x 0 ptof4y 0 pterr 0 ptrefset 0 ptmot x40800000 ptref 0}
125 {curvegroup Ellipse1 512 bezier
126 {{cc
127 {f 8192}
128 {px x4483e000
129 {xc1db2587 0}
130 {x42833332 x4179999c}
131 {x41db2586 0}
132 {0 xc1db2588}
133 {x42e66664 x42826666}
134 {0 x41db2588}
135 {x41db2586 0}
136 {x42833332 x42e59999}
137 {xc1db2587 0}
138 {0 x41db2588}
139 {x417ffff4 x42826666}
140 {0 xc1db2588}}}
141 {cc
142 {f 8192}
143 {px x4483e000
144 {xc1db2587 0}
145 {0 0}
146 {x41db2586 0}
147 {0 xc1db2588}
148 {0 0}
149 {0 x41db2588}
150 {x41db2586 0}
151 {0 0}
152 {xc1db2587 0}
153 {0 x41db2588}
154 {0 0}
155 {0 xc1db2588}}}}
156 {tx x4483e000 x4260cccc x4280cccd}
157 {a osw x41200000 osf 0 str 1 spx x44800000 spy x44100000 sb 1 ltn x4483e000 ltm x4483e000 tt x40e00000}}}}}}
158 toolbox {selectAll {
159 { selectAll str 1 ssx 1 ssy 1 sf 1 }
160 { createBezier str 1 ssx 1 ssy 1 sf 1 sb 1 tt 4 }
161 { createBezierCusped str 1 ssx 1 ssy 1 sf 1 sb 1 }
162 { createBSpline str 1 ssx 1 ssy 1 sf 1 sb 1 }
163 { createEllipse str 1 ssx 1 ssy 1 sf 1 sb 1 tt 7 }
164 { createRectangle str 1 ssx 1 ssy 1 sf 1 sb 1 }
165 { createRectangleCusped str 1 ssx 1 ssy 1 sf 1 sb 1 }
166 { brush str 1 ssx 1 ssy 1 sf 1 sb 1 }
167 { eraser src 2 str 1 ssx 1 ssy 1 sf 1 sb 1 }
168 { clone src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
169 { reveal src 3 str 1 ssx 1 ssy 1 sf 1 sb 1 }
170 { dodge src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
171 { burn src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
172 { blur src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
173 { sharpen src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
174 { smear src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
175} }
176 toolbar_brush_hardness 0.200000003
177 toolbar_source_transform_scale {1 1}
178 toolbar_source_transform_center {1024 576}
179 colorOverlay {0 0 0 0}
180 lifetime_type "all frames"
181 lifetime_start 1055
182 lifetime_end 1055
183 motionblur_shutter_offset_type centred
184 source_black_outside true
185 name Roto1
186 xpos -714
187 ypos 169
188 }
189 Blur {
190 channels alpha
191 size 23.4
192 name Blur1
193 xpos -714
194 ypos 207
195 }
196 Premult {
197 name Premult2
198 xpos -714
199 ypos 245
200 }
201 Crop {
202 box {0 0 128 128}
203 softness 25.8
204 name Crop1
205 xpos -714
206 ypos 271
207 }
208 Switch {
209 inputs 2
210 which {{customSpriteSwitch}}
211 name Switch1
212 xpos -714
213 ypos 319
214 }
215set Nc6486a80 [stack 0]
216 Dot {
217 name Dot1
218 xpos -422
219 ypos 323
220 }
221 Dot {
222 name Dot2
223 xpos -422
224 ypos 928
225 }
226 Input {
227 inputs 0
228 name camera
229 xpos -886
230 ypos 802
231 number 1
232 }
233push $Nc6486a80
234 BlendMat {
235 operation plus
236 surfaceblend modulate
237 name BlendMat1
238 xpos -714
239 ypos 369
240 }
241push 0
242push 0
243 ParticleEmitter {
244 inputs 3
245 emit_from faces
246 rate {{"frame-start_frame > 0 & frame-start_frame < 2 ? ((Cube1.volume/1000000)*particleDensity) : 0"}}
247 lifetime inf
248 velocity 0
249 size 1
250 size_variation 4
251 start_wrap true
252 seed {{parent.seed}}
253 name ParticleEmitter3
254 knobChanged 5
255 xpos -714
256 ypos 461
257 disable {{"guiDisable ? \$gui : 0"}}
258 }
259 ParticleExpression {
260 temp_name1 c
261 temp_expr1 "v(\[value Cube1.cube.x],\[value Cube1.cube.y],\[value Cube1.cube.n])"
262 temp_name2 b
263 temp_expr2 "v(\[value Cube1.cube.r],\[value Cube1.cube.t],\[value Cube1.cube.f])"
264 posexpr v(random*abs(x(c)-x(b))+x(c),random*abs(y(c)-y(b))+y(c),random*abs(z(c)-z(b))+z(c))
265 posexpr_onlynew true
266 name spread
267 xpos -714
268 ypos 487
269 disable {{"guiDisable ? \$gui : 0"}}
270 }
271 ParticleTurbulence {
272 strength {{waterSchmutz.tStrength} {strength.x} {strength.x}}
273 scale {{waterSchmutz.tScale} {scale.x} {scale.x}}
274 name ParticleTurbulence1
275 xpos -714
276 ypos 525
277 disable {{"guiDisable ? \$gui : 0"}}
278 }
279 ParticleWind {
280 to {5 0 0}
281 name ParticleWind1
282 xpos -714
283 ypos 563
284 disable {{"guiDisable ? \$gui : 0"}}
285 }
286 ParticleExpression {
287 temp_name1 f
288 temp_expr1 "v(\[value Cube1.cube.x],\[value Cube1.cube.y],\[value Cube1.cube.n])"
289 temp_name2 b
290 temp_expr2 "v(\[value Cube1.cube.r],\[value Cube1.cube.t],\[value Cube1.cube.f])"
291 temp_name3 poz
292 temp_expr3 pos
293 posexpr v(x(poz)>x(b)?x(f):(x(poz)<x(f)?x(b):x(poz)),y(poz)>y(b)?y(f):(y(poz)<y(f)?y(b):y(poz)),z(poz)>z(b)?z(f):(z(poz)<z(f)?z(b):z(poz)))
294 name ParticleWrapper
295 xpos -714
296 ypos 601
297 disable {{"wrapPart == 0"}}
298 }
299 ParticleExpression {
300 temp_name0 f
301 temp_expr0 "v(\[value Cube1.cube.x],\[value Cube1.cube.y],\[value Cube1.cube.n])"
302 temp_name1 b
303 temp_expr1 "v(\[value Cube1.cube.r],\[value Cube1.cube.t],\[value Cube1.cube.f])"
304 temp_name2 m
305 temp_expr2 (abs((v(x(f),y(f),z(f))-v(x(b),y(b),z(b))))/2)+f
306 temp_name3 fade
307 temp_expr3 (1-(abs(x(pos)-x(m)))/abs(x(f)-x(m)))*(1-(abs(y(pos)-y(m)))/abs(y(f)-y(m)))*(1-(abs(z(pos)-z(m)))/abs(z(f)-z(m)))
308 opacityexpr "\[value edgefade] <=0 ? 1 : fade*(1/\[value edgefade])"
309 name ParticleExpression1
310 xpos -714
311 ypos 639
312 disable {{"edgefade == 0 "}}
313 }
314 TransformGeo {
315 translate {{parent.Cube1.translate} {parent.Cube1.translate} {parent.Cube1.translate}}
316 rotate {{parent.Cube1.rotate} {parent.Cube1.rotate} {parent.Cube1.rotate}}
317 pivot {{parent.Cube1.pivot} {parent.Cube1.pivot} {parent.Cube1.pivot}}
318 name TransformGeo1
319 xpos -714
320 ypos 712
321 }
322 Constant {
323 inputs 0
324 channels rgb
325 format "128 128 0 0 128 128 1 128x128"
326 name Constant2
327 xpos -592
328 ypos 657
329 }
330 Reformat {
331 resize distort
332 name Reformat3
333 xpos -592
334 ypos 729
335 }
336 Reformat {
337 type scale
338 scale 0.5
339 name Reformat2
340 xpos -592
341 ypos 802
342 disable {{"proxyRender == 0"}}
343 }
344add_layer {p p.x p.y p.z}
345 ScanlineRender {
346 inputs 3
347 conservative_shader_sampling false
348 antialiasing medium
349 motion_vectors_type distance
350 output_shader_vectors true
351 P_channel p
352 name ScanlineRender1
353 xpos -714
354 ypos 802
355 }
356 Reformat {
357 format {{{parent.Reformat3.format}}}
358 pbb true
359 name Reformat4
360 xpos -714
361 ypos 868
362 }
363 Switch {
364 inputs 2
365 which {{spriteView}}
366 name Switch2
367 xpos -714
368 ypos 924
369 }
370 Output {
371 name Output1
372 xpos -714
373 ypos 976
374 }
375end_group