Advertisement
nistaani

Nuke - Nan Be Gone

Apr 18th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. set cut_paste_input [stack 0]
  2. version 11.3 v3
  3. push $cut_paste_input
  4. Group {
  5. name NaNbeGone
  6. help "Finds Negative, infinite, and NaN pixels and gives them an alpha value of 0 with the good pixels get a value of 1. Then the input is premulted using that alpha, then merged atop a blurred version of the input to \"fill\" in the bad pixel. \n\n"
  7. selected true
  8. xpos 8793
  9. ypos 13394
  10. addUserKnob {20 NaNbeGone l "Nan Be Gone"}
  11. addUserKnob {7 blurSize l "Blur Size" t "-controls the blurring of the surrounding pixels to fill in the dead pix." R 0 10}
  12. blurSize 1
  13. addUserKnob {4 alphaSwitch l "Alpha Channel:" M {"Do nothing" "Clamp blacks to zero" "Fill inf, nan and neg pixels with blur" ""}}
  14. alphaSwitch "Clamp blacks to zero"
  15. }
  16. Input {
  17. inputs 0
  18. name Input1
  19. xpos 462
  20. ypos 489
  21. }
  22. Dot {
  23. name Dot118
  24. xpos 496
  25. ypos 529
  26. }
  27. set N4e110fd0 [stack 0]
  28. Dot {
  29. name Dot2
  30. xpos 800
  31. ypos 529
  32. }
  33. set N41d72e80 [stack 0]
  34. Dot {
  35. name Dot1
  36. xpos 930
  37. ypos 529
  38. }
  39. set Nf1335a10 [stack 0]
  40. Shuffle {
  41. red alpha
  42. green alpha
  43. blue alpha
  44. name Shuffle9
  45. label alpha>red
  46. xpos 1007
  47. ypos 520
  48. }
  49. set N8fcf41c0 [stack 0]
  50. Expression {
  51. expr3 r<0||g<0||b<0||isinf(r)||isinf(g)||isinf(b)||isnan(r)||isnan(g)||isnan(b)?0:1
  52. name Expression5
  53. label <0?
  54. xpos 1156
  55. ypos 598
  56. disable {{curve}}
  57. }
  58. set N1796e940 [stack 0]
  59. Invert {
  60. channels alpha
  61. name Invert7
  62. xpos 1156
  63. ypos 670
  64. }
  65. push $N1796e940
  66. push $N8fcf41c0
  67. Copy {
  68. inputs 2
  69. from0 rgba.alpha
  70. to0 rgba.alpha
  71. name Copy8
  72. xpos 1007
  73. ypos 598
  74. }
  75. Premult {
  76. name Premult10
  77. xpos 1007
  78. ypos 697
  79. }
  80. set Nddf8a630 [stack 0]
  81. Blur {
  82. size {{blurSize}}
  83. name Blur10
  84. xpos 1007
  85. ypos 729
  86. }
  87. Unpremult {
  88. name Unpremult6
  89. xpos 1007
  90. ypos 776
  91. }
  92. push $Nddf8a630
  93. Merge2 {
  94. inputs 2+1
  95. bbox intersection
  96. name Merge86
  97. xpos 1156
  98. ypos 776
  99. }
  100. Shuffle {
  101. green red
  102. blue red
  103. alpha red
  104. name Shuffle19
  105. label RED
  106. xpos 1156
  107. ypos 831
  108. }
  109. push $Nf1335a10
  110. Clamp {
  111. channels alpha
  112. name Clamp1
  113. xpos 896
  114. ypos 731
  115. }
  116. push $N41d72e80
  117. Switch {
  118. inputs 3
  119. which {{alphaSwitch}}
  120. name Switch1
  121. xpos 766
  122. ypos 1026
  123. }
  124. push $N4e110fd0
  125. Expression {
  126. expr3 r<0||g<0||b<0||isinf(r)||isinf(g)||isinf(b)||isnan(r)||isnan(g)||isnan(b)?0:1
  127. name Expression1
  128. label <0?
  129. xpos 611
  130. ypos 597
  131. disable {{curve}}
  132. }
  133. set N9f2fea90 [stack 0]
  134. Invert {
  135. channels alpha
  136. name Invert3
  137. xpos 611
  138. ypos 665
  139. }
  140. push $N9f2fea90
  141. push $N4e110fd0
  142. Copy {
  143. inputs 2
  144. from0 rgba.alpha
  145. to0 rgba.alpha
  146. name Copy7
  147. xpos 462
  148. ypos 597
  149. }
  150. Premult {
  151. name Premult9
  152. xpos 462
  153. ypos 696
  154. }
  155. set Ne919c0b0 [stack 0]
  156. Blur {
  157. size {{blurSize}}
  158. name Blur3
  159. xpos 462
  160. ypos 727
  161. }
  162. Unpremult {
  163. name Unpremult5
  164. xpos 462
  165. ypos 775
  166. }
  167. push $Ne919c0b0
  168. Merge2 {
  169. inputs 2+1
  170. bbox intersection
  171. name Merge79
  172. xpos 611
  173. ypos 775
  174. }
  175. Copy {
  176. inputs 2
  177. from0 rgba.alpha
  178. to0 rgba.alpha
  179. name Copy11
  180. xpos 611
  181. ypos 1020
  182. }
  183. Dot {
  184. name Dot119
  185. xpos 645
  186. ypos 1265
  187. }
  188. Output {
  189. name Output1
  190. xpos 611
  191. ypos 1363
  192. }
  193. end_group
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement