Nuke Gizmos

From Antoine Vienne | Wiki
Jump to navigation Jump to search

Nuke Custom Gizmos

Normal Relight

//Custom adaptation from "V-Ray Relight" Gizmo by Alexandre Ribeiro.
//Choose the channel of your Normal pass in "NameNormal".

Root {
 inputs 0
 frame 11
 last_frame 16
 lock_range true
 format "2048 2048 0 0 2048 2048 1 square_2K"
 proxy_type scale
 proxy_format "1024 778 0 0 1024 778 1 1K_Super_35(full-ap)"
 colorManagement Nuke
 workingSpaceLUT linear
 monitorLut sRGB
 int8Lut sRGB
 int16Lut sRGB
 logLut Cineon
 floatLut linear
}
add_layer {ShN ShN.red ShN.green ShN.blue ShN.alpha}
Group {
 inputs 0
 name Normal_Relight
 selected true
 xpos 840
 ypos 86
 addUserKnob {20 settings}
 addUserKnob {41 longitude T Constant1.longitude}
 addUserKnob {41 latitude T Constant1.latitude}
 addUserKnob {6 postmult l post-multiply +STARTLINE}
 postmult true
 addUserKnob {20 NameNormal}
 addUserKnob {41 in l "in 1" T Shuffle8.in}
}
 Constant {
  inputs 0
  channels rgb
  color {{sin(radians(longitude))*cos(radians(latitude))} {sin(radians(latitude))} {cos(radians(longitude))*cos(radians(latitude))} 0}
  format "256 256 0 0 256 256 1 square_256"
  name Constant1
  xpos 180
  ypos -105
  addUserKnob {20 User}
  addUserKnob {7 longitude R -180 180}
  longitude 82
  addUserKnob {7 latitude R -90 90}
  latitude 44.5
 }
set N5ac82000 [stack 0]
 Input {
  inputs 0
  name Input1
  xpos -36
  ypos -202
 }
add_layer {VRay_Normals VRay_Normals.X VRay_Normals.Y VRay_Normals.Z}
 Shuffle {
  in ShN
  out VRay_Normals
  name Shuffle8
  xpos -36
  ypos -154
 }
 Expression {
  channel0 {none none none VRay_Normals.Z}
  expr0 VRay_Normals.Z-(1-a)
  channel1 none
  channel2 none
  channel3 none
  name Expression1
  xpos -36
  ypos -118
 }
 Unpremult {
  channels VRay_Normals
  name Unpremult1
  xpos -36
  ypos -71
 }
 MergeExpression {
  inputs 2
  expr0 Ar*BVRay_Normals.X
  expr1 Ag*BVRay_Normals.Y
  expr2 Ab*BVRay_Normals.Z
  channel3 none
  name MergeExpression1
  xpos 21
  ypos 2
 }
 Expression {
  channel0 rgb
  expr0 r+b+g
  channel1 none
  channel2 none
  channel3 none
  name Expression2
  xpos 21
  ypos 54
 }
 Premult {
  name Premult1
  xpos 21
  ypos 111
  disable {{1-parent.postmult}}
 }
set Na4942380 [stack 0]
 Output {
  name Output1
  xpos 21
  ypos 172
 }
push $N5ac82000
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push $Na4942380
 Viewer {
  inputs 10
  frame_range 1-16
  name Viewer1
  selected true
  xpos 233
  ypos 152
 }
end_group

Position Pass

// Select a specific zone to alpha from position pass.
// This script comes from Jean-François Theault.

set cut_paste_input [stack 0]
version 10.5 v4
push $cut_paste_input
add_layer {POSITION POSITION.red POSITION.green POSITION.blue}
Group {
 name Group1
 help "<b>P_Matte</b> creates a sphere or cube shaped 3D matte based on\na pass/layer containing position data"
 knobChanged "\nn = nuke.thisNode()\nk = nuke.thisKnob()\ns =\nnuke.toNode('SphereMatte')\nr = nuke.toNode('Start_End')\n\nif k.name()\n== \"falloffType\":\n    n\['falloff'].setVisible( k.value() != 'None'\n)\n    n\['exp'].setVisible( k.value() == 'Exponential' )\n\n"
 selected true
 xpos 2903
 ypos 344
 addUserKnob {20 User}
 addUserKnob {41 in l "position data" t "Choose a layer from the input\nthat contains position data" T Shuffle_Input_Channels.in}
 addUserKnob {41 output t "Resulting matte will be written to this layer\nonly" T OutChannel.out}
 addUserKnob {6 unpremultiply t "Check if your position layer is\npremultiplied" +STARTLINE}
 addUserKnob {6 useAlpha l "ignore outside alpha" t "If your input has\nan alpha channel, checking this will force everything outside that alpha\nchannel to be black" -STARTLINE}
 useAlpha true
 addUserKnob {26 ""}
 addUserKnob {4 matteShape t "Choose the shape of the 3D matte. Current\noptions are \"Sphere\" and \"Cube\"" M {Sphere Cube ""}}
 matteShape Cube
 addUserKnob {41 center t "Sample the viewer or copy XYZ coordinates\nhere to choose the center of the 3D sphere or cube" T Center.center}
 addUserKnob {26 ""}
 addUserKnob {41 rot_order l "rotation order" T Axis1.rot_order}
 addUserKnob {41 rotate T Axis1.rotate}
 addUserKnob {41 scaling l scale T Axis1.scaling}
 addUserKnob {41 uniform_scale l "uniform scale" T Axis1.uniform_scale}
 addUserKnob {41 skew T Axis1.skew}
 addUserKnob {41 pivot T Axis1.pivot}
 addUserKnob {26 ""}
 addUserKnob {4 falloffType M {None Linear Smooth Quadratic Cubic Exponential ""}}
 falloffType Exponential
 addUserKnob {7 falloff}
 falloff 1
 addUserKnob {7 exp R 0.1 10}
 exp 0.1
}
 Input {
  inputs 0
  name img
  xpos -828
  ypos -353
 }
 AddChannels {
  channels alpha
  color 1
  name AddChannels1
  xpos -828
  ypos -259
 }
 Shuffle {
  in POSITION
  alpha blue
  out rgb
  name Shuffle_Input_Channels
  xpos -828
  ypos -198
 }
set N7196d60 [stack 0]
 Unpremult {
  name Unpremult1
  xpos -646
  ypos -198
  disable {{!parent.unpremultiply i}}
 }
 Dot {
  name Dot2
  xpos -326
  ypos -193
 }
 Add {
  channels rgb
  value {{-center i} {-center i} {-center i} {curve i}}
  name Center
  xpos -360
  ypos -160
  addUserKnob {20 User}
  addUserKnob {18 center}
  center {66.5625 10.0390625 -31.046875}
  addUserKnob {6 center_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
 }
 Add {
  channels rgb
  value {{-Axis1.world_matrix.3 i} {-Axis1.world_matrix.7 i} {-Axis1.world_matrix.11 i} {curve i}}
  name Translate_Pivot
  xpos -360
  ypos -116
 }
 ColorMatrix {
  matrix {
      {{Axis1.world_matrix.0 i} {Axis1.world_matrix.1 i} {Axis1.world_matrix.2 i}}
      {{Axis1.world_matrix.4 i} {Axis1.world_matrix.5 i} {Axis1.world_matrix.6 i}}
      {{Axis1.world_matrix.8 i} {Axis1.world_matrix.9 i} {Axis1.world_matrix.10 i}}
    }
  invert true
  name Rotate_Scale_Skew
  xpos -360
  ypos -88
  disable {{hasError i x200 1}}
 }
set N71cf150 [stack 0]
 Expression {
  expr3 "(parent.useAlpha &&  a == 0.0 )? 0 : 1-max(abs(r),abs(g),abs(b))"
  name CubeMatte
  xpos -285
  ypos -11
 }
push $N71cf150
 Expression {
  expr3 "(parent.useAlpha &&  a == 0.0 )? 0 : 1-(sqrt((r*r)+(g*g)+(b*b)))"
  name SphereMatte
  xpos -442
  ypos -12
 }
 Switch {
  inputs 2
  which {{matteShape i}}
  name Switch1
  xpos -366
  ypos 58
 }
 Grade {
  channels alpha
  whitepoint {{falloffType?falloff:0}}
  white_clamp true
  name Falloff
  xpos -366
  ypos 124
 }
set N7202600 [stack 0]
 Expression {
  expr3 pow(a,parent.exp)
  name Exponential
  xpos -81
  ypos 229
 }
push $N7202600
 Expression {
  expr3 clamp((a**3),0,1)
  name Cubic
  xpos -175
  ypos 228
 }
push $N7202600
 Expression {
  expr3 clamp(pow2(a),0,1)
  name Quadratic
  xpos -269
  ypos 227
 }
push $N7202600
 Expression {
  expr3 smoothstep(0,1,a)
  name Smooth
  xpos -366
  ypos 230
 }
push $N7202600
 NoOp {
  name Linear
  xpos -457
  ypos 231
 }
push $N7202600
 NoOp {
  name None
  xpos -557
  ypos 231
 }
 Switch {
  inputs 6
  which {{falloffType i}}
  name Switch2
  xpos -366
  ypos 318
 }
 Remove {
  operation keep
  channels alpha
  name Remove1
  xpos -366
  ypos 378
 }
 Shuffle {
  in alpha
  out alpha
  name OutChannel
  xpos -366
  ypos 439
 }
push $N7196d60
 Dot {
  name Dot1
  xpos -794
  ypos 527
 }
 Copy {
  inputs 2
  from0 -rgba.alpha
  to0 -rgba.alpha
  channels all
  name Copy1
  xpos -366
  ypos 508
 }
 Output {
  name Output1
  xpos -366
  ypos 637
 }
 Axis2 {
  inputs 0
  xform_order STR
  rot_order ZYX
  scaling {5 2.3 9}
  uniform_scale 0.36
  name Axis1
  xpos -86
  ypos -102
 }
end_group

Push pixel

//Don't know the source of this custom Push pixel

set cut_paste_input [stack 0]
version 10.5 v7
push $cut_paste_input
Unpremult {
 name Unpremult4
 selected true
 xpos 180
 ypos 3374
}
Grade {
 channels alpha
 blackpoint 0.99
 name Grade15
 selected true
 xpos 180
 ypos 3416
}
Premult {
 name Premult1
 selected true
 xpos 180
 ypos 3470
}
EdgeBlur {
 size 1
 name EdgeBlur2
 selected true
 xpos 180
 ypos 3536
}
Unpremult {
 name Unpremult11
 selected true
 xpos 180
 ypos 3590
}
Expression {
 channel3 alpha
 expr3 "r == 0 ? 0 : 1"
 name Expression7
 selected true
 xpos 180
 ypos 3638
}
EdgeBlur {
 size 2
 name EdgeBlur3
 selected true
 xpos 180
 ypos 3704
}
Unpremult {
 name Unpremult12
 selected true
 xpos 180
 ypos 3758
}
Expression {
 channel3 alpha
 expr3 "r == 0 ? 0 : 1"
 name Expression8
 selected true
 xpos 180
 ypos 3806
}
EdgeBlur {
 size 4
 name EdgeBlur4
 selected true
 xpos 180
 ypos 3872
}
Unpremult {
 name Unpremult14
 selected true
 xpos 180
 ypos 3926
}
Expression {
 channel3 alpha
 expr3 "r == 0 ? 0 : 1"
 name Expression9
 selected true
 xpos 180
 ypos 3974
}
EdgeBlur {
 size 8
 name EdgeBlur12
 selected true
 xpos 180
 ypos 4040
}
Unpremult {
 name Unpremult15
 selected true
 xpos 180
 ypos 4094
}
Expression {
 channel3 alpha
 expr3 "r == 0 ? 0 : 1"
 name Expression10
 selected true
 xpos 180
 ypos 4142
}
EdgeBlur {
 size 16
 name EdgeBlur13
 selected true
 xpos 180
 ypos 4208
}
Unpremult {
 name Unpremult16
 selected true
 xpos 180
 ypos 4262
}
Expression {
 channel3 alpha
 expr3 "r == 0 ? 0 : 1"
 name Expression11
 selected true
 xpos 180
 ypos 4310
}