#! /data/studio/upipe/apps/nuke/11.1v1/bin/linux/centos7/libnuke-11.1.1.so -nx
version 11.1 v1
Group {
name bm_OpticalGlow
 knobChanged "n1 = nuke.thisNode()\nk1 = nuke.thisKnob()\nif k1.name() == \"effectOnly\":\n    if k1.value() == 1:\n        n1\[\"mergeType\"].setEnabled(False)\n    else:\n        n1\[\"mergeType\"].setEnabled(True) \n\n\nn2 = nuke.thisNode()\nk2 = nuke.thisKnob()\nif k2.name() == \"useThresholdCheckbox\":\n    if k2.value() == 1:\n        n2\[\"viewRange\"].setEnabled(True)\n    else:\n        n2\[\"viewRange\"].setEnabled(False)"
 tile_color 0x222222ff
 addUserKnob {20 Options}
 addUserKnob {4 mergeType l "Merge Operation" M {Max Over Screen Plus "" "" ""}}
 addUserKnob {26 spacer_01 l "" -STARTLINE T "      "}
 addUserKnob {6 effectOnly l " Effect Only" -STARTLINE}
 addUserKnob {4 glowType l "Glow Math" M {Double Fibonacci ""}}
 glowType Fibonacci
 addUserKnob {26 spacer_02 l "" -STARTLINE T "   "}
 addUserKnob {6 useThresholdCheckbox l "Use Threshold" -STARTLINE}
 addUserKnob {6 cropBboxCheck l "Crop BBox   " +STARTLINE}
 cropBboxCheck true
 addUserKnob {6 viewRange l "View Threshold" -STARTLINE +DISABLED}
 addUserKnob {26 ""}
 addUserKnob {20 tGrp l "Threshold Selector" n 1}
 tGrp 0
 addUserKnob {26 spacer_03 l "" +STARTLINE T " "}
 addUserKnob {41 range l "" +STARTLINE T Keyer1.range}
 addUserKnob {26 spacer_04 l "" +STARTLINE T " "}
 addUserKnob {20 endGroup n -1}
 addUserKnob {26 ""}
 addUserKnob {7 glowSize l Size R 0 500}
 glowSize 100
 addUserKnob {7 glowAspect l Aspect R 0.5 2}
 glowAspect 1
 addUserKnob {7 glowBrightness l Brightness R 0 3}
 glowBrightness 1
 addUserKnob {18 glowGamma l Gamma R 0 2}
 glowGamma 1
 addUserKnob {6 glowGamma_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {6 glowGamma_panelDropped_1 l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {6 glowGamma_panelDropped_1_1 l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {6 glowGamma_panelDropped_1_1_1 l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {6 glowGamma_panelDropped_1_1_1_1 l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {6 glowGamma_panelDropped_1_1_1_1_1 l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {6 glowGamma_panelDropped_1_1_1_1_1_1 l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {6 glowGamma_panelDropped_1_1_1_1_1_1_1 l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {18 glowSaturation l Saturation R 0 3}
 glowSaturation 1
 addUserKnob {6 glowSaturation_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {6 glowSaturation_panelDropped_1 l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {6 glowSaturation_panelDropped_1_1 l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {6 glowSaturation_panelDropped_1_1_1 l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {6 glowSaturation_panelDropped_1_1_1_1 l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {6 glowSaturation_panelDropped_1_1_1_1_1 l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {6 glowSaturation_panelDropped_1_1_1_1_1_1 l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {6 glowSaturation_panelDropped_1_1_1_1_1_1_1 l "panel dropped state" -STARTLINE +HIDDEN}
 addUserKnob {26 ""}
 addUserKnob {4 alphaChoice l "Use Alpha From" M {Plate "Glow Only" "Glow Range" "Plate & Glow" ""}}
 alphaChoice "Plate & Glow"
 addUserKnob {7 glowMix l Mix}
 glowMix 1
 addUserKnob {26 ""}
 addUserKnob {20 versionInfo l Info}
 addUserKnob {26 ""}
 addUserKnob {26 versionInfo_1 l "" +STARTLINE T "\nCreated by Ben McEwan\nwww.benmcewan.com\n\nVersion 3.1\nLast Updated: February 9th, 2018\n"}
 addUserKnob {26 ""}
}
 Input {
  inputs 0
  name Input
  xpos -1113
  ypos -1060
 }
 Expression {
  expr3 a==0?0:a
  name Expression1
  label "Alpha Error Fix"
  xpos -1113
  ypos -1006
 }
 Dot {
  name Dot1
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -1079
  ypos -918
 }
set N98be530 [stack 0]
 Dot {
  name Dot21
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -1079
  ypos 85
 }
set N9a91590 [stack 0]
 Dot {
  name Dot25
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -1304
  ypos 85
 }
 Dot {
  name Dot26
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -1304
  ypos 582
 }
set Nac89d20 [stack 0]
 Crop {
  box {0 0 {input.width} {input.height}}
  name Crop1
  xpos -1338
  ypos 1030
 }
push $N98be530
 Keyer {
  operation "luminance key"
  name Keyer1
  xpos -732
  ypos -927
 }
set N9688300 [stack 0]
 Dot {
  name Dot27
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos 554
  ypos -918
 }
 Dot {
  name Dot28
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos 554
  ypos 585
 }
set N980f080 [stack 0]
 Shuffle {
  in alpha
  red alpha
  name Shuffle2
  tile_color 0xffffff01
  label "\[value alpha] > \[value out]"
  xpos 520
  ypos 883
 }
push $N9688300
 Premult {
  name Premult1
  xpos -732
  ypos -891
 }
push $N98be530
 Switch {
  inputs 2
  which {{useThresholdCheckbox}}
  name Switch3
  xpos -732
  ypos -810
 }
 Dot {
  name Dot2
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -698
  ypos -754
 }
set N970e6f0 [stack 0]
 Dot {
  name Dot11
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -578
  ypos -754
 }
set N999c9a0 [stack 0]
 Dot {
  name Dot10
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -444
  ypos -754
 }
set N971c080 [stack 0]
 Dot {
  name Dot9
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -314
  ypos -754
 }
set N98022d0 [stack 0]
 Dot {
  name Dot8
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -185
  ypos -754
 }
set N8a6f360 [stack 0]
 Dot {
  name Dot7
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -75
  ypos -754
 }
set N9754320 [stack 0]
 Dot {
  name Dot6
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos 47
  ypos -754
 }
set Na3ffd900 [stack 0]
 Dot {
  name Dot5
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos 179
  ypos -754
 }
set N5aef6300 [stack 0]
 Dot {
  name Dot4
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos 301
  ypos -754
 }
set N5aefa550 [stack 0]
 Dot {
  name Dot3
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos 421
  ypos -754
 }
 Blur {
  size {{(glowType==0?(glowSize*25.6):(glowSize*5.5))*glowAspect} {glowType==0?(glowSize*25.6):(glowSize*5.5)}}
  name Blur10
  xpos 387
  ypos -714
 }
 Multiply {
  channels rgb
  value {{glowType==0?(glowBrightness/512):(glowBrightness/50)}}
  name Multiply10
  xpos 387
  ypos -678
 }
 Dot {
  name Dot13
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos 421
  ypos -92
 }
push $N5aefa550
 Blur {
  size {{(glowType==0?(glowSize*12.8):(glowSize*3.4))*glowAspect} {glowType==0?(glowSize*12.8):(glowSize*3.4)}}
  name Blur9
  xpos 267
  ypos -712
 }
 Multiply {
  channels rgb
  value {{glowType==0?(glowBrightness/256):(glowBrightness/33)}}
  name Multiply9
  xpos 267
  ypos -676
 }
 Dot {
  name Dot14
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos 301
  ypos -156
 }
push $N5aef6300
 Blur {
  size {{(glowType==0?(glowSize*6.4):(glowSize*2.1))*glowAspect} {glowType==0?(glowSize*6.4):(glowSize*2.1)}}
  name Blur8
  xpos 145
  ypos -716
 }
 Multiply {
  channels rgb
  value {{glowType==0?(glowBrightness/128):(glowBrightness/20)}}
  name Multiply8
  xpos 145
  ypos -680
 }
 Dot {
  name Dot15
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos 179
  ypos -221
 }
push $Na3ffd900
 Blur {
  size {{(glowType==0?(glowSize*3.2):(glowSize*1.3))*glowAspect} {glowType==0?(glowSize*3.2):(glowSize*1.3)}}
  name Blur7
  xpos 13
  ypos -717
 }
 Multiply {
  channels rgb
  value {{glowType==0?(glowBrightness/64):(glowBrightness/12.5)}}
  name Multiply7
  xpos 13
  ypos -681
 }
 Dot {
  name Dot16
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos 47
  ypos -285
 }
push $N9754320
 Blur {
  size {{(glowType==0?(glowSize*1.6):(glowSize/1.25))*glowAspect} {glowType==0?(glowSize*1.6):(glowSize/1.25)}}
  name Blur6
  xpos -109
  ypos -716
 }
 Multiply {
  channels rgb
  value {{glowType==0?(glowBrightness/32):(glowBrightness/7.68)}}
  name Multiply6
  xpos -109
  ypos -680
 }
 Dot {
  name Dot17
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -75
  ypos -354
 }
push $N8a6f360
 Blur {
  size {{(glowType==0?(glowSize/12.5):(glowSize/2))*glowAspect} {glowType==0?(glowSize/12.5):(glowSize/2)}}
  name Blur5
  xpos -219
  ypos -719
 }
 Multiply {
  channels rgb
  value {{glowType==0?(glowBrightness/16):(glowBrightness/4.75)}}
  name Multiply5
  xpos -219
  ypos -683
 }
 Dot {
  name Dot18
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -185
  ypos -421
 }
push $N98022d0
 Blur {
  size {{(glowType==0?(glowSize/2.5):(glowSize/3.3333))*glowAspect} {glowType==0?(glowSize/2.5):(glowSize/3.3333)}}
  name Blur4
  xpos -348
  ypos -721
 }
 Multiply {
  channels rgb
  value {{glowType==0?(glowBrightness/8):(glowBrightness/2.94)}}
  name Multiply4
  xpos -348
  ypos -685
 }
 Dot {
  name Dot19
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -314
  ypos -479
 }
push $N971c080
 Blur {
  size {{(glowSize/5)*glowAspect} {glowSize/5}}
  name Blur3
  selected true
  xpos -478
  ypos -723
 }
 Multiply {
  channels rgb
  value {{glowType==0?(glowBrightness/4):(glowBrightness/1.815)}}
  name Multiply3
  xpos -478
  ypos -687
 }
 Dot {
  name Dot20
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -444
  ypos -535
 }
push $N999c9a0
 Blur {
  size {{(glowSize/10)*glowAspect} {glowSize/10}}
  name Blur2
  xpos -612
  ypos -723
 }
 Multiply {
  channels rgb
  value {{glowType==0?(glowBrightness/2):(glowBrightness/1.124)}}
  name Multiply2
  xpos -612
  ypos -687
 }
 Dot {
  name Dot12
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -578
  ypos -592
 }
push $N970e6f0
 Blur {
  size {{glowSize/50}}
  name Blur1
  xpos -732
  ypos -722
 }
 Multiply {
  channels rgb
  value {{glowBrightness}}
  name Multiply1
  xpos -732
  ypos -686
 }
 Merge2 {
  inputs 2
  operation plus
  name Merge1
  xpos -732
  ypos -595
 }
 Merge2 {
  inputs 2
  operation plus
  name Merge2
  xpos -732
  ypos -538
 }
 Merge2 {
  inputs 2
  operation plus
  name Merge3
  xpos -732
  ypos -482
 }
 Merge2 {
  inputs 2
  operation plus
  name Merge4
  xpos -732
  ypos -424
 }
 Merge2 {
  inputs 2
  operation plus
  name Merge5
  xpos -732
  ypos -357
 }
 Merge2 {
  inputs 2
  operation plus
  name Merge6
  xpos -732
  ypos -288
 }
 Merge2 {
  inputs 2
  operation plus
  name Merge7
  xpos -732
  ypos -224
 }
 Merge2 {
  inputs 2
  operation plus
  name Merge8
  xpos -732
  ypos -159
 }
 Merge2 {
  inputs 2
  operation plus
  name Merge9
  xpos -732
  ypos -95
 }
 Multiply {
  channels alpha
  value 0.1
  name Multiply22
  xpos -732
  ypos -57
 }
 ColorCorrect {
  saturation {{glowSaturation} {glowSaturation} {glowSaturation} 1}
  gamma {{glowGamma} {glowGamma} {glowGamma} 1}
  name ColorCorrect1
  xpos -732
  ypos -21
 }
 Multiply {
  value {{glowType==0?(glowMix):(glowMix/2.5)}}
  name Multiply11
  xpos -732
  ypos 3
 }
 Dot {
  name Dot24
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -698
  ypos 149
 }
set Nd01a2670 [stack 0]
 Dot {
  name Dot22
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -472
  ypos 227
 }
 Dot {
  name Dot23
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -472
  ypos 420
 }
set Nd01abc40 [stack 0]
push $Nd01a2670
push $N9a91590
 Merge2 {
  inputs 2
  operation plus
  name Merge13
  xpos -650
  ypos 258
 }
push $Nd01a2670
push $N9a91590
 Merge2 {
  inputs 2
  operation screen
  name Merge12
  xpos -752
  ypos 257
 }
push $Nd01a2670
push $N9a91590
 Merge2 {
  inputs 2
  name Merge11
  xpos -860
  ypos 259
 }
push $Nd01a2670
push $N9a91590
 Merge2 {
  inputs 2
  operation max
  name Merge10
  xpos -1113
  ypos 259
 }
 Switch {
  inputs 4
  which {{mergeType}}
  name Switch1
  xpos -819
  ypos 340
 }
 Switch {
  inputs 2
  which {{effectOnly}}
  name Switch2
  xpos -819
  ypos 416
 }
set Nac4765e0 [stack 0]
 Dot {
  name Dot29
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -918
  ypos 491
 }
 Dot {
  name Dot30
  label "  "
  note_font "Arial Black"
  note_font_size 16
  xpos -918
  ypos 718
 }
push $N980f080
push $Nac4765e0
 Copy {
  inputs 2
  from0 rgba.alpha
  to0 rgba.alpha
  name Copy3
  xpos -564
  ypos 576
 }
push $Nd01abc40
push $Nac4765e0
 Copy {
  inputs 2
  from0 rgba.alpha
  to0 rgba.alpha
  name Copy2
  xpos -702
  ypos 574
 }
push $Nac89d20
push $Nac4765e0
 Copy {
  inputs 2
  from0 rgba.alpha
  to0 rgba.alpha
  name Copy1
  xpos -819
  ypos 573
 }
 Switch {
  inputs 4
  which {{alphaChoice}}
  name Switch4
  xpos -819
  ypos 715
 }
 Switch {
  inputs 2
  which {{viewRange x1 0}}
  name Switch5
  xpos -819
  ypos 889
 }
 CopyBBox {
  inputs 2
  name CopyBBox1
  xpos -817
  ypos 1030
  disable {{!cropBboxCheck}}
 }
 Output {
  name Output1
  xpos -817
  ypos 1191
 }
end_group
