Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.52 KB | None | 0 0
  1. set cut_paste_input [stack 0]
  2. version 12.1 v1
  3. push 0
  4. push $cut_paste_input
  5. Group {
  6. inputs 2
  7. name grade_Luminance
  8. knobChanged "\nk = nuke.toNode('Keymix1')\n\nif nuke.thisKnob().name() == 'inputChange':\n if nuke.thisNode().input(1) != None:\n k\['maskChannel'].setValue('rgba.alpha')\n else:\n k\['maskChannel'].setValue('none')\n"
  9. selected true
  10. xpos 80
  11. ypos 1250
  12. addUserKnob {20 Main}
  13. addUserKnob {41 blackpoint T MainGrade.blackpoint}
  14. addUserKnob {41 whitepoint T MainGrade.whitepoint}
  15. addUserKnob {41 black l lift T MainGrade.black}
  16. addUserKnob {41 white l gain T MainGrade.white}
  17. addUserKnob {41 multiply T MainGrade.multiply}
  18. addUserKnob {41 add l offset T MainGrade.add}
  19. addUserKnob {41 gamma T MainGrade.gamma}
  20. addUserKnob {26 "" l " "}
  21. addUserKnob {6 Clamp l Clamp_bottom +STARTLINE}
  22. addUserKnob {26 ""}
  23. addUserKnob {41 maskChannel l "mask channel" T Keymix1.maskChannel}
  24. addUserKnob {26 ""}
  25. addUserKnob {26 Text l "" +STARTLINE T "Lightness grade by Pavel Uliashka, 2020"}
  26. addUserKnob {20 Shadows}
  27. addUserKnob {7 Offset R -0.7 0.7}
  28. addUserKnob {7 Saturation R 0 2}
  29. Saturation 1
  30. addUserKnob {6 PreviewMask l "Preview Mask" +STARTLINE}
  31. addUserKnob {41 lut l "" +STARTLINE T Keyer_Mask.lut}
  32. }
  33. Input {
  34. inputs 0
  35. name Input1
  36. xpos 818
  37. ypos 412
  38. }
  39. Colorspace {
  40. colorspace_out CIE-Lab
  41. name Colorspace4
  42. xpos 818
  43. ypos 489
  44. }
  45. Dot {
  46. name Dot6
  47. xpos 852
  48. ypos 589
  49. }
  50. set Nc1a4c400 [stack 0]
  51. Grade {
  52. channels {rgba.red -rgba.green -rgba.blue none}
  53. multiply 0.81
  54. black_clamp false
  55. name MainGrade
  56. xpos 818
  57. ypos 678
  58. }
  59. Dot {
  60. name Dot3
  61. xpos 852
  62. ypos 750
  63. }
  64. set Nc1a85c00 [stack 0]
  65. Dot {
  66. name Dot1
  67. xpos 989
  68. ypos 750
  69. }
  70. Expression {
  71. expr0 r<=0?max(abs(r),g,b):r
  72. name Expression1
  73. xpos 955
  74. ypos 809
  75. }
  76. Group {
  77. name Keyer_Mask
  78. help "Rebuilt Nuke Keyer. Non-clamped, so values can exceed 1.0. Added LUT color controls, so you can perform gamma corrections or any other cc you desire. Output is in the Alpha."
  79. tile_color 0xff00ff
  80. label "\[value opT]"
  81. xpos 955
  82. ypos 872
  83. addUserKnob {20 CBuehler l "Keyer CB"}
  84. addUserKnob {41 channels T Remove1.channels}
  85. addUserKnob {41 opT l operation t "None of these operations are clamped. They're all based on the in coming channels, which you can turn on and off as desired." T Expression2.opT}
  86. addUserKnob {6 cMath l clamp -STARTLINE}
  87. addUserKnob {6 iNv l invert -STARTLINE}
  88. addUserKnob {6 keep0 l "keep 0" t "Anything that is the value of zero, will remain zero. Great for premultiplied images." -STARTLINE}
  89. addUserKnob {26 range l "range (alpha only)"}
  90. addUserKnob {6 usecc l "<font size=\"3\"><font color=\"Goldenrod\">use CC" +STARTLINE}
  91. usecc true
  92. addUserKnob {35 APresets l " " t "Alpha presets" -STARTLINE M {"alpha presets/4 points" "knob ColorLookup1.lut \{master \{\} red \{\} green \{\} blue \{\} alpha \{curve C 0 s0 u0 v0 1 s0 u0 v0 x1.1 1 s0 u0 v0 1 s0 u0 v0\}\}" "alpha presets/2 points" "knob ColorLookup1.lut \{master \{\} red \{\} green \{\} blue \{\} alpha \{curve C 0 s0 u0 v0 1 s0 u0 v0\}\}" "alpha presets/2 points smooth" "knob ColorLookup1.lut \{master \{\} red \{\} green \{\} blue \{\} alpha \{curve 0 s0 1 s0\}\}"}}
  93. addUserKnob {41 choice l " feather type" -STARTLINE T Expression.choice}
  94. addUserKnob {41 lut l "" +STARTLINE T ColorLookup1.lut}
  95. addUserKnob {32 Chad l ChadB t "Go to nukepedia.com to download the latest version, leave a comment/request or a bug." T "start http://www.vfxconnection.com/profile/Buehler" +STARTLINE}
  96. addUserKnob {26 version l "" -STARTLINE T " by Chad Buehler v1.9 "}
  97. }
  98. Input {
  99. inputs 0
  100. name Input1
  101. xpos 290
  102. ypos 235
  103. }
  104. set Nc1a85000 [stack 0]
  105. Dot {
  106. name Dot1
  107. xpos 178
  108. ypos 398
  109. }
  110. push $Nc1a85000
  111. Remove {
  112. operation keep
  113. channels {rgba.red -rgba.green -rgba.blue none}
  114. name Remove1
  115. xpos 290
  116. ypos 301
  117. }
  118. Expression {
  119. temp_name0 lumMax
  120. temp_expr0 "((max(r, g, b))+(min(r, g, b)))/2"
  121. temp_name1 deltaMax
  122. temp_expr1 "max(r, g, b)-min(r, g, b)"
  123. temp_name2 pick
  124. temp_expr2 "opT==0?r:opT==1?g:opT==2?b:opT==3?1-(r-max(g,b)):opT==4?1-(g-max(r,b)):opT==5?1-(b-max(r,g)):opT==6?(r*.2125)+(g*.7154)+(b*.0721):opT==7?max(abs(lumMax<0.5?deltaMax/((max(r, g, b))+(min(r, g, b))):deltaMax/(2 -(max(r, g, b))-(min(r, g, b))))==inf?0:(lumMax<0.5?deltaMax/((max(r, g, b))+(min(r, g, b))):deltaMax/(2 -(max(r, g, b))-(min(r, g, b)))),0):opT==8?max(abs(deltaMax/max(r, g, b))==inf?0:(deltaMax/max(r, g, b)),0):opT==9?max(r,g,b):opT==10?min(r,g,b):opT==11?1-((1-r)-max(1-g,1-b)):opT==12?1-((1-g)-max(1-r,1-b)):opT==13?1-((1-b)-max(1-r,1-g)):0"
  125. temp_name3 pf
  126. temp_expr3 "abs(pick)==inf || isnan(pick)?0:pick"
  127. expr3 pf
  128. maskChannelMask -rgba.alpha
  129. maskChannelInput -rgba.alpha
  130. unpremult -rgba.alpha
  131. name Expression2
  132. xpos 290
  133. ypos 346
  134. addUserKnob {20 Buehler l User}
  135. addUserKnob {4 opT l operation M {"red keyer" "green keyer" "blue keyer" redscreen greenscreen bluescreen "luminance key" "saturation key (HSL)" "saturation key (HSV)" "max keyer" "min keyer" cyanscreen magentascreen yellowscreen}}
  136. }
  137. Clamp {
  138. channels alpha
  139. maskChannelMask -rgba.alpha
  140. maskChannelInput -rgba.alpha
  141. unpremult -rgba.alpha
  142. name Clamp1
  143. xpos 290
  144. ypos 408
  145. disable {{!parent.cMath i}}
  146. }
  147. Invert {
  148. channels alpha
  149. maskChannelMask -rgba.alpha
  150. maskChannelInput -rgba.alpha
  151. unpremult -rgba.alpha
  152. name Invert1
  153. xpos 290
  154. ypos 461
  155. disable {{"iNv ==1 && keep0 == 0 ? 0 : 1" i}}
  156. }
  157. MergeExpression {
  158. inputs 2
  159. expr3 "Aa == 0 ? 0 : parent.iNv == 1 ? 1-Ba : Ba"
  160. name MergeExpression3
  161. xpos 290
  162. ypos 535
  163. disable {{"keep0 == 1 ? 0 : 1" i}}
  164. }
  165. ColorLookup {
  166. lut {master {curve C k 0 s0 1 s0}
  167. red {}
  168. green {}
  169. blue {}
  170. alpha {}}
  171. name ColorLookup1
  172. xpos 290
  173. ypos 591
  174. disable {{!parent.usecc}}
  175. }
  176. Expression {
  177. temp_name0 cl
  178. temp_expr0 clamp(a)
  179. expr3 "a >= 0 && a <= 1 ? choice == 1 ? cl*cl*(3 - 2*cl) : choice == 2 ? cl*(1 + cl*(1 - cl)) : choice == 3 ? cl*cl*(2 - cl) : choice == 4 ? pow(cl, 3) : choice == 5 ? 1.01832 - exp(-4 * cl) : a : a"
  180. name Expression
  181. xpos 290
  182. ypos 633
  183. disable {{!parent.usecc i}}
  184. addUserKnob {20 User}
  185. addUserKnob {4 choice l "feather type" M {linear smooth smooth1 smooth0 plinear "ease in"}}
  186. }
  187. ModifyMetaData {
  188. metadata {
  189. {set version "Keyer_CB 1.9"}
  190. }
  191. name MetaDataVersion
  192. xpos 290
  193. ypos 678
  194. }
  195. Output {
  196. name Output1
  197. xpos 290
  198. ypos 723
  199. }
  200. end_group
  201. Invert {
  202. channels alpha
  203. name Invert1
  204. xpos 955
  205. ypos 951
  206. }
  207. set Nc0f14400 [stack 0]
  208. Dot {
  209. name Dot9
  210. xpos 1142
  211. ypos 961
  212. }
  213. Shuffle {
  214. red alpha
  215. green alpha
  216. blue alpha
  217. out rgb
  218. name Shuffle1
  219. xpos 1108
  220. ypos 1410
  221. }
  222. Input {
  223. inputs 0
  224. name Mask
  225. label Mask
  226. xpos 1226
  227. ypos 405
  228. number 1
  229. }
  230. Invert {
  231. channels alpha
  232. name Invert2
  233. xpos 1226
  234. ypos 869
  235. }
  236. Dot {
  237. name Dot5
  238. xpos 1260
  239. ypos 1139
  240. }
  241. push $Nc1a4c400
  242. Dot {
  243. name Dot7
  244. xpos 725
  245. ypos 589
  246. }
  247. Dot {
  248. name Dot8
  249. xpos 725
  250. ypos 1139
  251. }
  252. push $Nc0f14400
  253. Dot {
  254. name Dot2
  255. xpos 989
  256. ypos 1038
  257. }
  258. set Nc0f4a400 [stack 0]
  259. Dot {
  260. name Dot4
  261. xpos 989
  262. ypos 1064
  263. }
  264. push $Nc0f4a400
  265. push $Nc1a85c00
  266. Grade {
  267. inputs 1+1
  268. channels {-rgba.red rgba.green rgba.blue none}
  269. multiply {{parent.Saturation}}
  270. black_clamp false
  271. name Saturation
  272. xpos 818
  273. ypos 1034
  274. }
  275. Grade {
  276. inputs 1+1
  277. channels {rgba.red -rgba.green -rgba.blue none}
  278. add {{parent.Offset}}
  279. black_clamp false
  280. name Luminance
  281. selected true
  282. xpos 818
  283. ypos 1060
  284. }
  285. Keymix {
  286. inputs 3
  287. name Keymix1
  288. xpos 818
  289. ypos 1129
  290. }
  291. Colorspace {
  292. colorspace_in CIE-Lab
  293. name Colorspace5
  294. xpos 818
  295. ypos 1194
  296. }
  297. Clamp {
  298. maximum_enable false
  299. name Clamp1
  300. xpos 818
  301. ypos 1274
  302. disable {{!parent.Clamp}}
  303. }
  304. Switch {
  305. inputs 2
  306. which {{parent.PreviewMask.main}}
  307. name Switch1
  308. xpos 818
  309. ypos 1410
  310. }
  311. Output {
  312. name Output1
  313. xpos 818
  314. ypos 1507
  315. }
  316. end_group
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement