forked from openNuke/toolset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
relight.nk
768 lines (768 loc) · 17.1 KB
/
relight.nk
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
#http://www.nukepedia.com/gizmos/other/relight v1.4 Michael Garrett
set cut_paste_input [stack 0]
version 9.0 v1
push $cut_paste_input
add_layer {N N.X N.Y N.Z}
add_layer {P P.X P.Y P.Z}
Group {
name Relight
help "Relight is driven by a Light (Light2 class) node and relights a 2D image based on rendered point positions and normal vectors in the vec input. It also uses a camera to calculate specular.\n\nCurrently the cone in the spotlight light type matches the Nuke spotlight closely but not exactly, and the cone falloff knob is unsupported.\n\nAdditional features are diffuse wrap for simulating fill light, and energy conserving normalized specular, meaning that the specular intensity increases and decreases proportional to shininess."
selected true
xpos -138
ypos -39
addUserKnob {20 Relight}
addUserKnob {6 use_alpha l "use alpha" +STARTLINE}
addUserKnob {41 normal l "normal vectors" T Shuffle2.in}
addUserKnob {41 point l "point positions" T Shuffle1.in}
addUserKnob {4 camera t "The camera position is used to calculate the specular reflection. Choose either a Nuke 3D camera (cam input) or, if available, derive the camera position from RenderMan OpenEXR metadata (vec input)." M {"nuke camera" "renderman openexr metadata" "" "" "" "" "" ""}}
addUserKnob {22 loadExrReader l "load Exr reader" -STARTLINE T "def exrCam(): \n\tdef getMetadataMatrix(meta_list):\n\t m = nuke.math.Matrix4()\n\t try: \n\t\t for i in range(0,16):\n\t\t\t m\[i] = meta_list\[i] \n\t except:\n\t\t m.makeIdentity()\n\t return m\n \n\tn=nuke.thisNode()\n \n\thold=int(n\['frameHold'].value())\n \n\tcamMatrix = getMetadataMatrix(n.metadata('exr/worldToCamera',hold))\n \n\tflipZ=nuke.math.Matrix4()\n\tflipZ.makeIdentity()\n\tflipZ.scale(1,1,-1)\n \n\ttransposedMatrix = nuke.math.Matrix4(camMatrix)\n\ttransposedMatrix.transpose()\n\ttransposedMatrix=transposedMatrix*flipZ\n\tinvMatrix=transposedMatrix.inverse()\t\n \n\tn\['matrix'].setValue(invMatrix\[0],0)\n\tn\['matrix'].setValue(invMatrix\[1],1)\n\tn\['matrix'].setValue(invMatrix\[2],2)\n\tn\['matrix'].setValue(invMatrix\[3],3)\n\tn\['matrix'].setValue(invMatrix\[4],4)\n\tn\['matrix'].setValue(invMatrix\[5],5)\n\tn\['matrix'].setValue(invMatrix\[6],6)\n\tn\['matrix'].setValue(invMatrix\[7],7)\n\tn\['matrix'].setValue(invMatrix\[8],8)\n\tn\['matrix'].setValue(invMatrix\[9],9)\n\tn\['matrix'].setValue(invMatrix\[10],10)\n\tn\['matrix'].setValue(invMatrix\[11],11)\n\tn\['matrix'].setValue(invMatrix\[12],12)\n\tn\['matrix'].setValue(invMatrix\[13],13)\n\tn\['matrix'].setValue(invMatrix\[14],14)\n\tn\['matrix'].setValue(invMatrix\[15],15)\n\treturn"}
addUserKnob {26 material l "Phong material"}
addUserKnob {18 mcolor l color}
mcolor {1 1 1}
addUserKnob {6 mcolor_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
addUserKnob {7 diffuse R 0 4}
diffuse 0.18
addUserKnob {7 wrap l "diffuse wrap" R 90 360}
wrap 90
addUserKnob {7 specular R 0 4}
specular 0.8
addUserKnob {6 energy_conserving l "energy conserving" t "This isn't a full blown \"energy conserving shader\" solution, but more of a test implementation of normalizing the specular so that the phong lobe area remains constant regardless of the shininess. This can be visualized with a slice tool. \n\nFor large specular sizes, this will diminish the overall spec intensity and for small tight spec sizes it will greatly increase the spec intensity, so watch out for massive overbrights and adjust accordingly. \n" +STARTLINE}
energy_conserving true
addUserKnob {7 shininess R 2 100}
shininess 10
addUserKnob {20 Info}
addUserKnob {22 documentation l " Documentation / Feedback " T "import webbrowser\nwebbrowser.open(/'http://opennuke.github.io/relight_nk/')" +STARTLINE}
addUserKnob {26 ""}
addUserKnob {26 version l version: T 1.4}
addUserKnob {26 created l created: T "23/10/2010 by <a href=\\'http://www.nukepedia.com/gizmos/other/relight'> Michael Garrett.</a>"}
addUserKnob {26 source l source: T "23/10/2010 by <a href=\\'http://www.nukepedia.com/gizmos/other/relight'> Nukepedia.</a>"}
addUserKnob {26 licence l licence: T "<a href=\"https://github.com/openNuke/toolset/blob/master/LICENCE\">READ ME</a>"}
}
BackdropNode {
inputs 0
name BackdropNode1
tile_color 0x7171c600
label "reflection vector"
note_font_size 42
xpos -438
ypos -184
bdwidth 482
bdheight 608
}
BackdropNode {
inputs 0
name BackdropNode2
tile_color 0x8e8e3800
label directional
note_font_size 42
xpos -5
ypos 601
bdwidth 492
bdheight 558
}
BackdropNode {
inputs 0
name BackdropNode3
tile_color 0x8e8e3800
label point
note_font_size 42
xpos 734
ypos 532
bdwidth 670
bdheight 657
}
BackdropNode {
inputs 0
name BackdropNode5
tile_color 0x7171c600
label "spotlight cone maths"
note_font_size 12
xpos 1474
ypos 620
bdwidth 154
bdheight 356
}
Input {
inputs 0
name vec
xpos 217
ypos -611
}
Dot {
name Dot4
xpos 251
ypos -480
}
set N4d8443b0 [stack 0]
Dot {
name Dot1
xpos -458
ypos -480
}
Dot {
name Dot2
xpos -475
ypos 1269
}
set N4d84c940 [stack 0]
push $N4d84c940
push $N4d8443b0
Shuffle {
in P
out rgb
name Shuffle1
label "point to rgb"
xpos 336
ypos -338
}
set N4d850c30 [stack 0]
Expression {
expr0 translate.x-r
expr1 translate.y-g
expr2 translate.z-b
name VectorL
xpos 1028
ypos 547
addUserKnob {20 User}
addUserKnob {13 translate}
translate {{"\[lindex \[lindex \[value Axis1.world_matrix] 0] 3]" i} {"\[lindex \[lindex \[value Axis1.world_matrix] 1] 3]" i} {"\[lindex \[lindex \[value Axis1.world_matrix] 2] 3]" i}}
}
set N4d85da90 [stack 0]
Expression {
temp_name0 length
temp_expr0 sqrt((r*r)+(g*g)+(b*b))
expr0 r/length
expr1 g/length
expr2 b/length
name Normalize4
xpos 1028
ypos 573
}
set N4d86ab30 [stack 0]
push $N4d8443b0
Shuffle {
red black
green black
blue white
name Shuffle6
label "Make +z vector"
xpos 228
ypos 412
}
ColorMatrix {
matrix {
{{Axis1.world_matrix.0 i} {Axis1.world_matrix.1 i} {Axis1.world_matrix.2 i}}
{{Axis1.world_matrix.4 i} {Axis1.world_matrix.5 i} {Axis1.world_matrix.6 i}}
{{Axis1.world_matrix.8 i} {Axis1.world_matrix.9 i} {Axis1.world_matrix.10 i}}
}
name ColorMatrix3
label rotation
xpos 228
ypos 488
}
set N4d884600 [stack 0]
Dot {
name Dot9
xpos 1538
ypos 474
}
MergeExpression {
inputs 2
temp_name0 DotProduct
temp_expr0 (Ar*Br)+(Ag*Bg)+(Ab*Bb)
channel0 rgb
expr0 max(0,DotProduct)
name MergeExpression9
label "Dot product (L.A)"
xpos 1504
ypos 670
}
Expression {
temp_name0 radConeAngle
temp_expr0 radians(LightKnobs.coneAngle/2)
temp_name1 radInnerConeAngle
temp_expr1 radians(LightKnobs.innerConeAngle/2)
temp_name2 LdotA
temp_expr2 r
expr0 LdotA-cos(radConeAngle)
expr1 cos(radInnerConeAngle)-cos(radConeAngle)
expr2 0
channel3 {none none none -rgba.alpha}
maskChannelMask -rgba.alpha
name Expression3
label "Compare cosines of coneangles with L.A"
xpos 1504
ypos 770
}
Expression {
expr0 clamp(r/g)
name Expression1
label "Divide and clamp from 0-1"
xpos 1504
ypos 844
}
Expression {
channel0 rgb
expr0 pow(r,2)
channel1 {-rgba.red -rgba.green -rgba.blue none}
channel2 {-rgba.red -rgba.green -rgba.blue none}
name BasicConeFalloff
xpos 1504
ypos 929
}
Dot {
name Dot19
xpos 1538
ypos 1261
}
push $N4d85da90
Dot {
name Dot8
xpos 772
ypos 678
}
Dot {
name Dot6
xpos 772
ypos 1165
}
push $N4d86ab30
push $N4d850c30
push $N4d8443b0
push 0
Switch {
inputs 2
which {{parent.camera i}}
name Switch3
selected true
xpos 8
ypos -394
}
Matrix {
channels none
matrix {
{1 0 0 0}
{0 1 0 0}
{0 0 -1 0}
{0 0 0 1}
}
name Matrix1
label "working with callback in init.py"
xpos -97
ypos -360
addUserKnob {20 User}
addUserKnob {3 frameHold}
frameHold {{frame i}}
addUserKnob {3 doThis}
doThis {{"\[python exrCam()]" i}}
}
Expression {
temp_name0 R
temp_expr0 Matrix1.matrix.3
temp_name1 G
temp_expr1 Matrix1.matrix.7
temp_name2 B
temp_expr2 Matrix1.matrix.11
expr0 R
expr1 G
expr2 B
name Expression5
label "Get \"point world\" value \nof camera position"
xpos -97
ypos -281
}
push $N4d8443b0
Expression {
temp_name0 R
temp_expr0 Axis2.world_matrix.3
temp_name1 G
temp_expr1 Axis2.world_matrix.7
temp_name2 B
temp_expr2 Axis2.world_matrix.11
expr0 R
expr1 G
expr2 B
name Expression4
label "Get \"point world\" value \nof camera position"
xpos -305
ypos -384
}
Switch {
inputs 2
which {{camera i}}
name Switch2
label "select method for getting camera position"
xpos -305
ypos -260
}
Merge2 {
inputs 2
operation minus
Achannels rgb
Bchannels rgb
output {rgba.red rgba.green rgba.blue -rgba.alpha}
maskChannelMask -rgba.alpha
name Merge3
label "Cam to surface \nlight ray direction"
xpos -305
ypos -52
}
Expression {
temp_name0 length
temp_expr0 sqrt((r*r)+(g*g)+(b*b))
expr0 r/length
expr1 g/length
expr2 b/length
name Normalize2
xpos -305
ypos 20
}
set N3ba2e280 [stack 0]
Dot {
name Dot13
xpos -387
ypos 23
}
Dot {
name Dot14
xpos -387
ypos 318
}
push $N4d8443b0
Shuffle {
in N
out rgb
name Shuffle2
label "normals to rgb"
xpos 94
ypos -337
}
Expression {
temp_name0 length
temp_expr0 sqrt((r*r)+(g*g)+(b*b))
expr0 r/length
expr1 g/length
expr2 b/length
name Normalize6
xpos 94
ypos -297
}
set N3ba4fdf0 [stack 0]
Dot {
name Dot15
xpos -36
ypos 116
}
set N3ba5c510 [stack 0]
push $N3ba2e280
MergeExpression {
inputs 2
channel0 rgb
expr0 (Ar*Br)+(Ag*Bg)+(Ab*Bb)
channel1 {-rgba.red -rgba.green -rgba.blue none}
channel2 {-rgba.red -rgba.green -rgba.blue none}
channel3 {none none none -rgba.alpha}
maskChannelMask -rgba.alpha
name DotP1
label I.N
xpos -305
ypos 106
}
Multiply {
channels rgb
value 2
name Multiply5
label *2
xpos -305
ypos 146
}
Dot {
name Dot16
xpos -271
ypos 262
}
push $N3ba5c510
MergeExpression {
inputs 2
expr0 Ar*Br
expr1 Ag*Bg
expr2 Ab*Bb
name MergeExpression5
label *N
xpos -70
ypos 251
}
Merge2 {
inputs 2
operation minus
name Merge6
xpos -70
ypos 314
}
Expression {
temp_name0 length
temp_expr0 sqrt((r*r)+(g*g)+(b*b))
expr0 r/length
expr1 g/length
expr2 b/length
name Normalize3
xpos -70
ypos 365
}
Dot {
name Dot12
xpos 557
ypos 397
}
set N3baa05d0 [stack 0]
MergeExpression {
inputs 2
temp_name0 DotProduct
temp_expr0 (Ar*Br)+(Ag*Bg)+(Ab*Bb)
channel0 rgb
expr0 max(0,DotProduct)
name MergeExpression7
label "Dot product (N.L)"
xpos 877
ypos 748
}
Expression {
channel0 rgb
expr0 "pow(r, shininess)"
channel1 {-rgba.red -rgba.green -rgba.blue none}
channel2 {-rgba.red -rgba.green -rgba.blue none}
name shinyness1
xpos 877
ypos 837
addUserKnob {20 User}
addUserKnob {7 shininess R 0 10}
shininess {{parent.shininess i}}
}
set C3bab0710 [stack 0]
Expression {
temp_name0 nfactor
temp_expr0 (phexp+2)/(2*pi)
channel0 rgb
expr0 r*nfactor
channel1 {-rgba.red -rgba.green -rgba.blue none}
channel2 {-rgba.red -rgba.green -rgba.blue none}
channel3 {none none none -rgba.alpha}
name PhongNfactor
xpos 877
ypos 906
disable {{!energy_conserving}}
addUserKnob {20 User}
addUserKnob {7 phexp}
phexp {{parent.shininess}}
}
set C3babd250 [stack 0]
Multiply {
channels rgb
value {{parent.specular i}}
name Multiply1
label "Spec white point"
xpos 877
ypos 1032
}
set C3bac9fe0 [stack 0]
push $N4d86ab30
push $N3ba4fdf0
Dot {
name Dot5
xpos 1241
ypos 340
}
Dot {
name Dot7
xpos 1241
ypos 583
}
set N3bad8680 [stack 0]
MergeExpression {
inputs 2
temp_name0 DotProduct
temp_expr0 (Ar*Br)+(Ag*Bg)+(Ab*Bb)
channel0 rgb
expr0 max(0,DotProduct)
name MergeExpression2
label "Dot product (N.L)"
xpos 1128
ypos 742
}
push $N4d86ab30
push $N3bad8680
MergeExpression {
inputs 2
temp_name0 DotProduct
temp_expr0 (Ar*Br)+(Ag*Bg)+(Ab*Bb)
channel0 {rgba.red rgba.green rgba.blue -rgba.alpha}
expr0 "max(0, (1-acos(DotProduct)/radians(wrap)))"
channel1 none
channel2 none
channel3 none
unpremult -rgba.alpha
name MergeExpression6
label DotProduct_LightWrap
xpos 1287
ypos 741
addUserKnob {20 User}
addUserKnob {7 wrap R 90 360}
wrap {{parent.wrap.main i}}
}
Merge2 {
inputs 2
operation max
name Max1
xpos 1206
ypos 816
}
Multiply {
channels rgb
value {{parent.diffuse i}}
name Multiply4
label "Diffuse white point"
xpos 1206
ypos 1004
}
set C3e505e80 [stack 0]
Multiply {
channels rgb
value {{mcolor i} {mcolor i} {mcolor i} 1}
name Multiply2
label "Material colour"
xpos 1206
ypos 1044
}
set C3e510240 [stack 0]
Merge2 {
inputs 2
operation plus
name Merge2
xpos 1048
ypos 1123
}
MergeExpression {
inputs 2
temp_name0 length
temp_expr0 sqrt((Ar*Ar)+(Ag*Ag)+(Ab*Ab))
channel0 rgb
expr0 Br/pow(length,falloffval)
channel1 {-rgba.red -rgba.green -rgba.blue none}
channel2 {-rgba.red -rgba.green -rgba.blue none}
name OverallFalloff1
xpos 1048
ypos 1161
addUserKnob {20 User}
addUserKnob {7 falloffval R 0 3}
falloffval {{parent.LightKnobs.falloff_type i}}
}
set N3e527de0 [stack 0]
Merge2 {
inputs 2
operation multiply
Achannels rgb
Bchannels rgb
output rgb
name Merge5
xpos 1048
ypos 1257
}
push $N3baa05d0
push $N4d884600
MergeExpression {
inputs 2
temp_name0 DotProduct
temp_expr0 (Ar*Br)+(Ag*Bg)+(Ab*Bb)
channel0 rgb
expr0 max(0,DotProduct)
name MergeExpression1
label "Dot product"
xpos 315
ypos 732
}
clone $C3bab0710 {
xpos 315
ypos 845
selected false
}
clone $C3babd250 {
xpos 316
ypos 912
selected false
}
clone $C3bac9fe0 {
xpos 315
ypos 996
selected false
}
push $N3ba4fdf0
Dot {
name Dot3
xpos 77
ypos 551
}
set N3e570080 [stack 0]
push $N4d884600
MergeExpression {
inputs 2
temp_name0 DotProduct
temp_expr0 (Ar*Br)+(Ag*Bg)+(Ab*Bb)
channel0 rgb
expr0 max(0,DotProduct)
name MergeExpression3
label "Dot product (N.L)"
xpos 43
ypos 734
}
push $N3e570080
push $N4d884600
MergeExpression {
inputs 2
temp_name0 DotProduct
temp_expr0 (Ar*Br)+(Ag*Bg)+(Ab*Bb)
channel0 {rgba.red rgba.green rgba.blue -rgba.alpha}
expr0 "max(0, (1-acos(DotProduct)/radians(wrap)))"
channel1 none
channel2 none
channel3 none
unpremult -rgba.alpha
name MergeExpression4
label DotProduct_LightWrap
xpos 177
ypos 736
addUserKnob {20 User}
addUserKnob {7 wrap R 90 360}
wrap {{parent.wrap i}}
}
Merge2 {
inputs 2
operation max
name Max
xpos 113
ypos 852
}
clone $C3e505e80 {
xpos 113
ypos 953
selected false
}
clone $C3e510240 {
xpos 113
ypos 1012
selected false
}
Merge2 {
inputs 2
operation plus
name Merge1
xpos 231
ypos 1123
}
push $N3e527de0
Switch {
inputs 3
which {{parent.LightKnobs.light_type i}}
name Switch1
label "Light type"
xpos 601
ypos 1337
}
Multiply {
channels rgb
value {{parent.LightKnobs.intensity i}}
name Multiply6
label "Light intensity"
xpos 601
ypos 1401
}
Multiply {
channels rgb
value {{parent.LightKnobs.lcolor i} {parent.LightKnobs.lcolor i} {parent.LightKnobs.lcolor i} 1}
name Multiply3
label "Light colour"
xpos 601
ypos 1465
disable {{"!\[exists parent.input1]" i}}
}
Expression {
expr0 isnan(r)?0:r
expr1 isnan(g)?0:g
expr2 isnan(b)?0:b
name Expression2
label isnan
xpos 601
ypos 1515
}
Keymix {
inputs 3
channels rgb
invertMask true
name Keymix1
xpos 601
ypos 1595
disable {{!use_alpha i}}
}
Output {
name Output1
xpos 601
ypos 1681
}
Input {
inputs 0
name light
xpos 657
ypos -613
number 1
}
set N3e5efc60 [stack 0]
Axis2 {
selectable false
name Axis1
xpos 667
ypos -524
}
Input {
inputs 0
name cam
xpos -302
ypos -609
number 2
}
Axis2 {
name Axis2
xpos -292
ypos -541
}
push $N3e5efc60
Shuffle {
red black
green black
blue black
alpha black
name LightKnobs
xpos 895
ypos -323
disable {{"!\[exists parent.input1]" i}}
addUserKnob {20 User}
addUserKnob {3 light_type l "light type"}
light_type {{"\[input \[node this.parent] 1].light_type" i}}
addUserKnob {18 lcolor l color}
lcolor {{"\[input \[node this.parent] 1].color" i} {"\[input \[node this.parent] 1].color" i} {"\[input \[node this.parent] 1].color" i}}
addUserKnob {6 lcolor_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
addUserKnob {7 intensity R 0 50}
intensity {{"\[input \[node this.parent] 1].intensity" i}}
addUserKnob {7 cone_angle l "cone angle" R 0 180}
cone_angle {{"\[input \[node this.parent] 1].cone_angle" i}}
addUserKnob {7 cone_penumbra_angle l "cone penumbra angle" R -60 60}
cone_penumbra_angle {{"\[input \[node this.parent] 1].cone_penumbra_angle" i}}
addUserKnob {7 cone_falloff l "cone falloff" R 0 1000}
cone_falloff {{"\[input \[node this.parent] 1].cone_falloff" i}}
addUserKnob {3 falloff_type l "falloff type"}
falloff_type {{"\[input \[node this.parent] 1].falloff_type" i}}
addUserKnob {26 modified}
addUserKnob {7 coneAngle R 0 180}
coneAngle {{cone_penumbra_angle<=0?cone_angle:cone_angle+cone_penumbra_angle i}}
addUserKnob {7 innerConeAngle R 0 180}
innerConeAngle {{cone_penumbra_angle>0?cone_angle:cone_angle+cone_penumbra_angle i}}
}
end_group