LiQuidCrab

Colour Smear For Nuke

Jun 18th, 2020
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 11.20 KB | None | 0 0
  1. # colour-smear-for-Nuke
  2. #Smear out the colour of your A plate to create better edges.
  3.  
  4. Group {
  5.  name Colour_Smear
  6.  note_font Verdana
  7.  selected true
  8.  xpos -7
  9.  ypos 1452
  10.  addUserKnob {20 User}
  11.  addUserKnob {26 smearing l Smearing T ""}
  12.  addUserKnob {6 already_premulted l "Input is premultiplied?" t "Click checkbox \"on\" if image is already premulted" +STARTLINE}
  13.  already_premulted true
  14.  addUserKnob {7 pre_choke l Pre-choke R 0 30}
  15.  pre_choke 2.5
  16.  addUserKnob {7 pre_contrast l "Pre Contrast" R 0 0.5}
  17.  pre_contrast 0.084
  18.  addUserKnob {7 pre_blur l Pre-blur R 0 100}
  19.  pre_blur 8.5
  20.  addUserKnob {7 post_blur l "Post Blur" R 0 100}
  21.  post_blur 5.5
  22.  addUserKnob {26 ""}
  23.  addUserKnob {26 Masking}
  24.  addUserKnob {6 xor_edge_detect l "Use XOR edge detect method?" t "XOR edge detect will isolate edge mask to areas that are blurred. Regular edge detect method will apply smear evenly all the way around." +STARTLINE}
  25.  addUserKnob {7 dilate_mask l "Dilate Mask" R 0 30}
  26.  dilate_mask 2.8
  27.  addUserKnob {7 blur_mask l "Blur Mask" R 0 100}
  28.  blur_mask 3.5
  29.  addUserKnob {6 output_premulted l "Premultiply output" +STARTLINE}
  30.  output_premulted true
  31.  addUserKnob {26 ""}
  32.  addUserKnob {6 outputmask l "Output smear mask?" +STARTLINE}
  33.  outputmask true
  34.  addUserKnob {26 smearmask_description l " (uses 'smearmask.a' channel - handy for regraining later)" -STARTLINE}
  35.  addUserKnob {26 "" +STARTLINE}
  36.  addUserKnob {26 RestoreDetail l "Restore Detail"}
  37.  addUserKnob {7 sharpness l Sharpness R 0 10}
  38.  sharpness 10
  39.  addUserKnob {7 amount l Amount}
  40.  amount 0.1
  41.  addUserKnob {26 ""}
  42.  addUserKnob {26 credit l "" +STARTLINE T "Colour Smear v2.1 by Richard Frazer - www.richardfrazer.com"}
  43. }
  44.  BackdropNode {
  45.   inputs 0
  46.   name BackdropNode1
  47.   tile_color 0x7171c600
  48.   label "Restore detail"
  49.   note_font Verdana
  50.   note_font_size 42
  51.   xpos -833
  52.   ypos 14
  53.   bdwidth 546
  54.   bdheight 976
  55.  }
  56.  BackdropNode {
  57.   inputs 0
  58.   name BackdropNode18
  59.   tile_color 0x7171c600
  60.   label "unpremult / blur trick"
  61.   note_font Verdana
  62.   note_font_size 42
  63.   xpos 653
  64.   ypos 25
  65.   bdwidth 856
  66.   bdheight 999
  67.  }
  68.  BackdropNode {
  69.   inputs 0
  70.   name BackdropNode19
  71.   tile_color 0x7171c600
  72.   label "mask to smear back over shot"
  73.   note_font Verdana
  74.   note_font_size 42
  75.   xpos -239
  76.   ypos 27
  77.   bdwidth 649
  78.   bdheight 976
  79.  }
  80.  BackdropNode {
  81.   inputs 0
  82.   name BackdropNode20
  83.   tile_color 0x7171c600
  84.   label "colour smear\n<-- in here goes plate with alpha (unpremulted) "
  85.   note_font Verdana
  86.   note_font_size 42
  87.   xpos -1098
  88.   ypos -281
  89.   bdwidth 2603
  90.   bdheight 277
  91.  }
  92.  StickyNote {
  93.   inputs 0
  94.   name StickyNote20
  95.   label "bigger blur will smear\ncolour out further\nbut may cause\nbleed\nin areas of high contrast"
  96.   note_font Verdana
  97.   note_font_size 31
  98.   xpos 1122
  99.   ypos 405
  100.  }
  101.  StickyNote {
  102.   inputs 0
  103.   name StickyNote23
  104.   label "xor way \nisolates areas\nwith highest\namounts of blur\n(i.e\nmotion blur)"
  105.   note_font Verdana
  106.   note_font_size 31
  107.   xpos -338
  108.   ypos 288
  109.  }
  110.  StickyNote {
  111.   inputs 0
  112.   name StickyNote25
  113.   label "tweak the \ndilate and \nblur to make\nnice"
  114.   note_font Verdana
  115.   xpos -1
  116.   ypos 581
  117.  }
  118.  StickyNote {
  119.   inputs 0
  120.   name StickyNote24
  121.   label "choose which works best"
  122.   note_font Verdana
  123.   note_font_size 31
  124.   xpos -115
  125.   ypos 774
  126.  }
  127.  StickyNote {
  128.   inputs 0
  129.   name StickyNote22
  130.   label "this way \nsmears evenly\naround all\nedges"
  131.   note_font Verdana
  132.   note_font_size 31
  133.   xpos 211
  134.   ypos 235
  135.  }
  136.  StickyNote {
  137.   inputs 0
  138.   name StickyNote27
  139.   label "shuffle original alpha back in"
  140.   note_font Verdana
  141.   note_font_size 31
  142.   xpos -1369
  143.   ypos 1645
  144.  }
  145.  StickyNote {
  146.   inputs 0
  147.   name StickyNote26
  148.   label "smear back over edges"
  149.   note_font Verdana
  150.   note_font_size 31
  151.   xpos -1057
  152.   ypos 1295
  153.  }
  154.  StickyNote {
  155.   inputs 0
  156.   name StickyNote19
  157.   label "choke back alpha first\nso that no background\ncolour is bought in"
  158.   note_font Verdana
  159.   note_font_size 31
  160.   xpos 1131
  161.   ypos 229
  162.  }
  163.  StickyNote {
  164.   inputs 0
  165.   name StickyNote1
  166.   label "mask input - \nareas with solid matte\nwill be excluded from \nbeing effected"
  167.   note_font Verdana
  168.   note_font_size 31
  169.   xpos 1716
  170.   ypos -149
  171.  }
  172.  StickyNote {
  173.   inputs 0
  174.   name StickyNote21
  175.   label "just to soften areas\nwith hard edges"
  176.   note_font Verdana
  177.   note_font_size 31
  178.   xpos 682
  179.   ypos 670
  180.  }
  181.  Input {
  182.   inputs 0
  183.   name IMG
  184.   label "Your main image input"
  185.   note_font Verdana
  186.   xpos -1238
  187.   ypos -298
  188.  }
  189. set N6b5a400 [stack 0]
  190.  Dot {
  191.   name Dot29
  192.   note_font Verdana
  193.   xpos -1204
  194.   ypos -109
  195.  }
  196. set N6b5ee70 [stack 0]
  197.  Dot {
  198.   name Dot7
  199.   xpos -1204
  200.   ypos 1270
  201.  }
  202.  Dot {
  203.   name Dot18
  204.   note_font Verdana
  205.   xpos -1204
  206.   ypos 1564
  207.  }
  208. set N6b63950 [stack 0]
  209. push $N6b5ee70
  210.  Unpremult {
  211.   name Unpremult2
  212.   note_font Verdana
  213.   xpos -1073
  214.   ypos -108
  215.  }
  216. push $N6b5ee70
  217.  Switch {
  218.   inputs 2
  219.   which {{"\[value parent.already_premulted]" i}}
  220.   name Switch1
  221.   note_font Verdana
  222.   xpos -1073
  223.   ypos -56
  224.  }
  225.  Dot {
  226.   name Dot30
  227.   note_font Verdana
  228.   xpos -901
  229.   ypos -52
  230.  }
  231. set N6b78a00 [stack 0]
  232.  Dot {
  233.   name Dot5
  234.   xpos -562
  235.   ypos -52
  236.  }
  237. set N6b7d540 [stack 0]
  238.  Dot {
  239.   name Dot17
  240.   note_font Verdana
  241.   xpos 42
  242.   ypos -52
  243.  }
  244. set N6bbbe30 [stack 0]
  245.  Dot {
  246.   name Dot38
  247.   note_font Verdana
  248.   xpos 42
  249.   ypos 122
  250.  }
  251. set N6bc1fa0 [stack 0]
  252.  Dot {
  253.   name Dot145
  254.   note_font Verdana
  255.   xpos -39
  256.   ypos 122
  257.  }
  258. set N6bc6ac0 [stack 0]
  259.  Dot {
  260.   name Dot138
  261.   note_font Verdana
  262.   xpos -92
  263.   ypos 185
  264.  }
  265. push $N6bc6ac0
  266.  Dot {
  267.   name Dot39
  268.   note_font Verdana
  269.   xpos 4
  270.   ypos 193
  271.  }
  272.  Merge2 {
  273.   inputs 2
  274.   operation xor
  275.   name Merge14
  276.   note_font Verdana
  277.   xpos -71
  278.   ypos 243
  279.  }
  280.  Dilate {
  281.   channels alpha
  282.   size {{"\[value parent.dilate_mask]" i}}
  283.   name Dilate2
  284.   note_font Verdana
  285.   xpos -71
  286.   ypos 319
  287.  }
  288.  Grade {
  289.   channels alpha
  290.   gamma 2
  291.   black_clamp false
  292.   name Grade16
  293.   note_font Verdana
  294.   xpos -71
  295.   ypos 394
  296.  }
  297.  Clamp {
  298.   name Clamp2
  299.   note_font Verdana
  300.   xpos -71
  301.   ypos 432
  302.  }
  303.  Blur {
  304.   size {{"\[value parent.blur_mask]" i}}
  305.   name Blur13
  306.   note_font Verdana
  307.   xpos -71
  308.   ypos 516
  309.  }
  310.  Dot {
  311.   name Dot156
  312.   note_font Verdana
  313.   xpos -37
  314.   ypos 659
  315.  }
  316. push $N6bc1fa0
  317.  Dot {
  318.   name Dot20
  319.   note_font Verdana
  320.   xpos 119
  321.   ypos 122
  322.  }
  323.  Dilate {
  324.   channels alpha
  325.   size {{"-\[value parent.dilate_mask]" i}}
  326.   name Dilate4
  327.   note_font Verdana
  328.   xpos 85
  329.   ypos 271
  330.  }
  331.  Grade {
  332.   channels alpha
  333.   blackpoint 0.022
  334.   whitepoint 0.69
  335.   gamma 0.94
  336.   black_clamp false
  337.   name Grade18
  338.   note_font Verdana
  339.   xpos 85
  340.   ypos 344
  341.  }
  342.  Invert {
  343.   channels alpha
  344.   name Invert4
  345.   note_font Verdana
  346.   xpos 85
  347.   ypos 392
  348.  }
  349.  Clamp {
  350.   name Clamp8
  351.   note_font Verdana
  352.   xpos 85
  353.   ypos 430
  354.  }
  355.  Blur {
  356.   size {{"\[value parent.blur_mask]" i}}
  357.   name Blur17
  358.   note_font Verdana
  359.   xpos 85
  360.   ypos 510
  361.  }
  362.  Dot {
  363.   name Dot147
  364.   note_font Verdana
  365.   xpos 119
  366.   ypos 670
  367.  }
  368.  Switch {
  369.   inputs 2
  370.   which {{"\[value parent.xor_edge_detect]" i}}
  371.   name Switch3
  372.   note_font Verdana
  373.   xpos 7
  374.   ypos 747
  375.  }
  376. push $N6bbbe30
  377.  Dot {
  378.   name Dot71
  379.   note_font Verdana
  380.   xpos 1045
  381.   ypos -52
  382.  }
  383.  Dot {
  384.   name Dot1
  385.   note_font Verdana
  386.   xpos 1045
  387.   ypos 100
  388.  }
  389. set N6c79dd0 [stack 0]
  390. push $N6c79dd0
  391.  Input {
  392.   inputs 0
  393.   name OMIT
  394.   label "The area to omit from being affected"
  395.   note_font Verdana
  396.   xpos 1582
  397.   ypos -260
  398.   number 1
  399.  }
  400.  Dot {
  401.   name Dot2
  402.   note_font Verdana
  403.   xpos 1616
  404.   ypos 50
  405.  }
  406. set N6c84a80 [stack 0]
  407.  Merge2 {
  408.   inputs 2
  409.   operation out
  410.   name Merge1
  411.   note_font Verdana
  412.   xpos 1088
  413.   ypos 147
  414.  }
  415.  Switch {
  416.   inputs 2
  417.   name Switch4
  418.   note_font Verdana
  419.   xpos 1011
  420.   ypos 209
  421.  }
  422.  FilterErode {
  423.   channels alpha
  424.   size {{"\[value parent.pre_choke]" i}}
  425.   name FilterErode2
  426.   note_font Verdana
  427.   xpos 1011
  428.   ypos 280
  429.  }
  430.  Grade {
  431.   channels alpha
  432.   blackpoint {{"\[value parent.pre_contrast]"}}
  433.   whitepoint {{"1-\[value parent.pre_contrast]"}}
  434.   black_clamp false
  435.   name Grade19
  436.   note_font Verdana
  437.   xpos 1011
  438.   ypos 341
  439.  }
  440.  Clamp {
  441.   channels alpha
  442.   name Clamp4
  443.   note_font Verdana
  444.   xpos 1011
  445.   ypos 390
  446.  }
  447.  Premult {
  448.   name Premult3
  449.   note_font Verdana
  450.   xpos 1011
  451.   ypos 471
  452.  }
  453.  Blur {
  454.   size {{"\[value parent.pre_blur]" i}}
  455.   name Blur8
  456.   note_font Verdana
  457.   xpos 1011
  458.   ypos 560
  459.  }
  460.  Unpremult {
  461.   name Unpremult1
  462.   note_font Verdana
  463.   xpos 1011
  464.   ypos 643
  465.  }
  466.  Blur {
  467.   size {{"\[value parent.post_blur]" i}}
  468.   name Blur20
  469.   note_font Verdana
  470.   xpos 1011
  471.   ypos 704
  472.  }
  473.  Dot {
  474.   name Dot61
  475.   note_font Verdana
  476.   xpos 1045
  477.   ypos 795
  478.  }
  479.  ShuffleCopy {
  480.   inputs 2
  481.   name ShuffleCopy1
  482.   note_font Verdana
  483.   xpos 7
  484.   ypos 901
  485.  }
  486.  Premult {
  487.   name Premult4
  488.   note_font Verdana
  489.   xpos 7
  490.   ypos 1045
  491.  }
  492.  Dot {
  493.   name Dot4
  494.   note_font Verdana
  495.   xpos 41
  496.   ypos 1122
  497.  }
  498. set N6d13030 [stack 0]
  499.  Merge2 {
  500.   inputs 2
  501.   operation mask
  502.   name Merge5
  503.   xpos -498
  504.   ypos 1611
  505.  }
  506. push $N6b63950
  507. push $N6b7d540
  508.  Dot {
  509.   name Dot6
  510.   xpos -562
  511.   ypos 162
  512.  }
  513. set N6b81780 [stack 0]
  514. push $N6b81780
  515.  Blur {
  516.   size {{"\[value parent.sharpness]" i}}
  517.   name Blur1
  518.   xpos -728
  519.   ypos 211
  520.  }
  521.  Merge2 {
  522.   inputs 2
  523.   operation divide
  524.   name Merge3
  525.   xpos -596
  526.   ypos 283
  527.  }
  528.  ColorCorrect {
  529.   saturation 0
  530.   name ColorCorrect1
  531.   xpos -596
  532.   ypos 375
  533.  }
  534.  Dot {
  535.   name Dot8
  536.   xpos -554
  537.   ypos 1268
  538.  }
  539. push $N6d13030
  540. push $N6d13030
  541. push $N6c84a80
  542.  Dot {
  543.   name Dot3
  544.   note_font Verdana
  545.   xpos 1616
  546.   ypos 967
  547.  }
  548.  Merge2 {
  549.   inputs 2
  550.   operation out
  551.   name Merge2
  552.   note_font Verdana
  553.   xpos 76
  554.   ypos 1192
  555.  }
  556.  Switch {
  557.   inputs 2
  558.   name Switch5
  559.   note_font Verdana
  560.   xpos 7
  561.   ypos 1253
  562.  }
  563.  Unpremult {
  564.   name Unpremult3
  565.   xpos -471
  566.   ypos 1330
  567.  }
  568.  Merge2 {
  569.   inputs 2
  570.   operation multiply
  571.   output {rgba.red rgba.green rgba.blue -rgba.alpha}
  572.   mix {{"\[value parent.amount]"}}
  573.   name Merge4
  574.   xpos -588
  575.   ypos 1352
  576.  }
  577.  Premult {
  578.   name Premult1
  579.   xpos -588
  580.   ypos 1393
  581.  }
  582. push $N6b78a00
  583.  Merge2 {
  584.   inputs 2
  585.   name Merge13
  586.   note_font Verdana
  587.   xpos -935
  588.   ypos 1393
  589.  }
  590.  ShuffleCopy {
  591.   inputs 2
  592.   name ShuffleCopy2
  593.   note_font Verdana
  594.   xpos -1238
  595.   ypos 1725
  596.  }
  597. set N6d61c40 [stack 0]
  598.  Premult {
  599.   name Premult10
  600.   note_font Verdana
  601.   xpos -1130
  602.   ypos 1789
  603.  }
  604. push $N6d61c40
  605.  Switch {
  606.   inputs 2
  607.   which {{"\[value parent.output_premulted]" i}}
  608.   name Switch2
  609.   note_font Verdana
  610.   xpos -1238
  611.   ypos 1878
  612.  }
  613.  Dot {
  614.   name Dot9
  615.   xpos -1204
  616.   ypos 1996
  617.  }
  618. set Nf73c5670 [stack 0]
  619. add_layer {smearmask smearmask.a}
  620.  ShuffleCopy {
  621.   inputs 2
  622.   alpha alpha2
  623.   black alpha
  624.   out2 smearmask
  625.   name ShuffleCopy3
  626.   note_font Verdana
  627.   xpos -1140
  628.   ypos 2066
  629.  }
  630. push $Nf73c5670
  631.  Switch {
  632.   inputs 2
  633.   which {{"\[value parent.outputmask]"}}
  634.   name Switch6
  635.   note_font Verdana
  636.   selected true
  637.   xpos -1238
  638.   ypos 2141
  639.  }
  640. set Nf78bf650 [stack 0]
  641.  Dot {
  642.   name Dot19
  643.   note_font Verdana
  644.   xpos -1204
  645.   ypos 2343
  646.  }
  647.  Output {
  648.   name Output1
  649.   note_font Verdana
  650.   xpos -1238
  651.   ypos 2422
  652.  }
  653. push $Nf73c5670
  654. push 0
  655. push 0
  656. push 0
  657. push 0
  658. push $N6b5a400
  659. push $Nf78bf650
  660.  Viewer {
  661.   inputs 7
  662.   frame 1059
  663.   frame_range 1001-1368
  664.   fps 25
  665.   center_fstop 0
  666.   input_process false
  667.   name Viewer1
  668.   note_font Verdana
  669.   xpos -2639
  670.   ypos 1011
  671.  }
  672. end_group
Add Comment
Please, Sign In to add comment