Nuke Node Collection

Nodes

This is just a collection of useful grouped nuke node’s that I have created. I could have saved them out as .gizmo files (and maybe I will at some point) but to keep it simple you can just copy and paste the code from this blog directly into your .nk script. So what do I have below:

  • RGBA Extractor
  • Feathered ZSlice
  • Error Catch
  • Chromatic Aberration

RGBA Extractor (ID Matte)

RGBA Extractor Its basically a modified shuffle node, that lets you extract either the R,G,B or A channels from an image or any combination of all of them. It automatically detects the resolution of the incoming image and reformat’s itself to match. It also goes on with a few simple extras, such as an erode to grow or shrink the resulting matte, you can invert it, or even just be given an edge of that mask. Try it, you might find it as handy as I do. :p

set cut_paste_input [stack 0]
version 6.1 v3
push $cut_paste_input
Group {
 name CC_RGBA_Extractor
 tile_color 0xff5700ff
 label "15/07/2015\n"
 selected true
 xpos 599
 ypos 1339
 addUserKnob {20 RGBExtractor l "RGB Extractor"}
 addUserKnob {6 red l Red +STARTLINE}
 addUserKnob {6 green l Green +STARTLINE}
 green true
 addUserKnob {6 blue l Blue +STARTLINE}
 blue true
 addUserKnob {6 alpha l Alpha +STARTLINE}
 addUserKnob {26 ""}
 addUserKnob {41 size l "Erode Mask" T FilterErode1.size}
 addUserKnob {6 invert l "Invert Output" +STARTLINE}
 addUserKnob {6 enable_edge l "Edge Detect" +STARTLINE}
 addUserKnob {26 ""}
 addUserKnob {26 text l "" +STARTLINE T "*Auto-detects input resolution"}
}
 Input {
 inputs 0
 name Input1
 xpos -414
 ypos -609
 }
 Dot {
 name Dot3
 xpos -380
 ypos -448
 }
set N19845b40 [stack 0]
 Dot {
 name Dot2
 xpos -380
 ypos -331
 }
 NoOp {
 name Gather_Input_Data
 xpos -414
 ypos -197
 addUserKnob {20 User}
 addUserKnob {7 myWidth}
 myWidth {{input.width i}}
 addUserKnob {7 myHeight}
 myHeight {{input.height i}}
 }
push $N19845b40
 Shuffle {
 red alpha
 green alpha
 blue alpha
 name ALPHA
 selected true
 xpos -596
 ypos -316
 }
 Constant {
 inputs 0
 channels rgb
 name Constant2
 xpos -556
 ypos -240
 }
set N19846600 [stack 0]
 Switch {
 inputs 2
 which {{alpha}}
 name AlphaSwitch
 xpos -770
 ypos -316
 }
push $N19845b40
 Shuffle {
 red blue
 green blue
 alpha blue
 name BLUE
 xpos -595
 ypos -384
 }
push $N19846600
 Crop {
 box {0 0 {Gather_Input_Data.myWidth} {Gather_Input_Data.myHeight}}
 reformat true
 crop false
 name Crop_Reformat
 xpos -556
 ypos -140
 }
 Dot {
 name Dot1
 xpos -633
 ypos -136
 }
set N19846e10 [stack 0]
 Switch {
 inputs 2
 which {{blue i}}
 name BlueSwitch
 xpos -769
 ypos -384
 }
push 0
push $N19845b40
 Shuffle {
 green red
 blue red
 alpha red
 name RED
 xpos -586
 ypos -525
 }
push $N19846e10
 Switch {
 inputs 2
 which {{red i}}
 name RedSwitch
 xpos -771
 ypos -525
 }
push $N19845b40
 Shuffle {
 red green
 blue green
 alpha green
 name GREEN
 xpos -593
 ypos -452
 }
push $N19846e10
 Switch {
 inputs 2
 which {{green i}}
 name GreenSwitch
 xpos -771
 ypos -452
 }
 Merge2 {
 inputs 4+1
 operation plus
 Achannels {-rgba.red -rgba.green -rgba.blue rgba.alpha}
 Bchannels {-rgba.red -rgba.green -rgba.blue rgba.alpha}
 output {-rgba.red -rgba.green -rgba.blue rgba.alpha}
 also_merge all
 name Merge16
 xpos -954
 ypos -458
 }
 Dot {
 name Dot5
 xpos -1045
 ypos -448
 }
set N198478d0 [stack 0]
 Dilate {
 size 1
 name Dilate2
 xpos -1167
 ypos -370
 }
push $N198478d0
 Dilate {
 size -1
 name Dilate1
 xpos -1079
 ypos -317
 }
 Merge2 {
 inputs 2
 operation difference
 name Merge4
 xpos -1369
 ypos -311
 }
push $N198478d0
 Switch {
 inputs 2
 which {{enable_edge}}
 name EdgeOnly
 xpos -1369
 ypos -452
 }
 Dot {
 name Dot4
 xpos -1428
 ypos -448
 }
set N19848640 [stack 0]
 Invert {
 name Invert1
 xpos -1602
 ypos -552
 }
push $N19848640
 Switch {
 inputs 2
 which {{invert}}
 name Switch1
 xpos -1602
 ypos -452
 }
 Dot {
 name Dot6
 xpos -1697
 ypos -448
 }
 FilterErode {
 channels all
 size 0
 name FilterErode1
 xpos -1731
 ypos -341
 }
 Output {
 name Output1
 xpos -1731
 ypos -220
 }
end_group

The Feathered ZSlice

Feathered ZSlice An experimental node to produce a feathered slice based on the depth channel. It sorta works, but I have honestly never used it in a final comp. 😀 It actually only produces a mask based on the depth channel which you can then use later in your comp. It could easily be produced in other ways but this was really just for fun! Enjoy :)

set cut_paste_input [stack 0]
version 6.1 v3
push $cut_paste_input
Group {
 name CC_ZSlice_Feathered
 tile_color 0xff7700ff
 label 14/07/2015
 selected true
 xpos 1183
 ypos -1018
 addUserKnob {20 DepthMask l "Depth Mask"}
 addUserKnob {6 fg_enable l "Enable FG" -STARTLINE}
 fg_enable true
 addUserKnob {6 bg_enable l "Enable BG" -STARTLINE}
 bg_enable true
 addUserKnob {6 invert_enable l Invert -STARTLINE}
 addUserKnob {26 ""}
 addUserKnob {41 math -STARTLINE T Depth_Blur1.math}
 addUserKnob {41 Zchan l Z -STARTLINE T Depth_Blur1.Zchan}
 addUserKnob {41 center l "focus plane (C)" T Depth_Blur1.center}
 addUserKnob {41 dof l depth-of-field T Depth_Blur1.dof}
 addUserKnob {26 ""}
 addUserKnob {41 gamma l "BG Transition" T BG_Edge.gamma}
 addUserKnob {41 white l "BG Gain" T BG_Edge.white}
 addUserKnob {41 gamma_1 l "FG Transition" T FG_Edge.gamma}
 addUserKnob {41 white_1 l "FG Gain" T FG_Edge.white}
}
 Input {
 inputs 0
 name Input1
 xpos 196
 ypos 204
 }
set N198256d0 [stack 0]
 ZBlur {
 setup_mode true
 center 0.5
 dof 0.1
 size 8
 max_size 30
 name Depth_Blur1
 xpos 196
 ypos 335
 }
set N19825980 [stack 0]
 Shuffle {
 green red
 blue red
 alpha red
 name Shuffle7
 xpos 63
 ypos 407
 }
 Grade {
 channels all
 name FG_Edge
 xpos 63
 ypos 477
 }
 Constant {
 inputs 0
 channels rgb
 name Constant2
 xpos 198
 ypos 466
 }
set N19826190 [stack 0]
 Switch {
 inputs 2
 which {{fg_enable}}
 name FG
 xpos 63
 ypos 566
 }
push $N19825980
 Shuffle {
 red blue
 green blue
 alpha blue
 name Shuffle8
 xpos 326
 ypos 411
 }
 Grade {
 channels all
 name BG_Edge
 xpos 326
 ypos 479
 }
push $N19826190
 Switch {
 inputs 2
 which {{bg_enable}}
 name BG
 xpos 326
 ypos 564
 }
 Merge2 {
 inputs 2
 name Merge10
 xpos 201
 ypos 677
 }
set N198269a0 [stack 0]
 Invert {
 name Invert1
 xpos 101
 ypos 745
 }
push $N198269a0
 Switch {
 inputs 2
 which {{invert_enable}}
 name invert_switch
 xpos 201
 ypos 835
 }
set N169b6fa0 [stack 0]
 Output {
 name Output1
 xpos 201
 ypos 994
 }
push $N169b6fa0
push $N198256d0
 Dot {
 name Dot1
 xpos -83
 ypos 241
 }
 Merge2 {
 inputs 2
 operation multiply
 name Merge1
 xpos -117
 ypos 835
 }
push $N169b6fa0
 Viewer {
 viewerProcess None
 name Viewer1
 xpos -159
 ypos 998
 }
end_group

Error Catch

I noticed in Nuke 6 that often the option on the Read node to error out would not work when set to Checker, Black, etc. So, as long as it remains to error to ‘error’ this node works as a proper catch forcing the node to produce a black frame. I was using it a lot whilst plugging an entire scene into a ContactSheet node.

set cut_paste_input [stack 0]
version 6.1 v3
push $cut_paste_input
Group {
 name CC_Error_Catch1
 tile_color 0xff6400ff
 label 04/08/2015
 selected true
 xpos -905
 ypos -174
}
 Constant {
 inputs 0
 name Constant1
 xpos 715
 ypos -306
 }
 Input {
 inputs 0
 name Input
 label "\[value number]"
 xpos 494
 ypos -455
 }
 Switch {
 inputs 2
 which {{"\[value parent.input0.on_error] == 0 ? 0 : 1" x139 0 x156 0}}
 name Switch3
 selected true
 xpos 494
 ypos -283
 }
 Output {
 name Output1
 xpos 494
 ypos -148
 }
 Viewer {
 viewerProcess None
 input_process false
 name Viewer1
 xpos 244
 ypos -378
 }
end_group

Chromatic Aberration

Chromatic Aberration A simple node that adds adjustable chromatic aberration to your shot.

set cut_paste_input [stack 0]
version 6.1 v3
push $cut_paste_input
Group {
 name CC_Chromatic_Aberration
 tile_color 0xff5f00ff
 selected true
 xpos 207
 ypos 1345
 addUserKnob {20 ChromaticAbberation l "Chromatic Abberation"}
 addUserKnob {41 size l "Abberation Size" T Blur3.size}
 addUserKnob {7 abberationscale l "Abberation Scale" R 0.95 1.05}
 abberationscale 1.0015
}
 Input {
 inputs 0
 name Input1
 xpos -542
 ypos 350
 }
 GodRays {
 channels {-rgba.red rgba.green -rgba.blue}
 scale {{parent.abberationscale i}}
 name GodRays1
 xpos -542
 ypos 432
 }
set N169baf70 [stack 0]
 Dot {
 name Dot1
 xpos -305
 ypos 442
 }
 EdgeDetectWrapper {
 threshold 0.22
 name EdgeDetectWrapper1
 xpos -339
 ypos 500
 }
push $N169baf70
 Blur {
 inputs 1+1
 channels {rgba.red -rgba.green rgba.blue}
 size 0.25
 name Blur3
 xpos -542
 ypos 500
 }
 Output {
 name Output1
 xpos -542
 ypos 600
 }
end_group

Thats it for now :) I will update this page as I create new nodes/tools.

Tweet about this on TwitterShare on FacebookShare on Google+Share on TumblrPin on Pinterest

Leave a Reply