effectropy

vfx and that other thing


Leave a comment

Nuke Script – Multy Knob Changer

Oftentimes the sheer quantity of nodes in a Nuke script explodes more violently than New York City in your favourite Hollywood blockbuster. So it’s never a bad idea to have the right script at hand, to help you deal with ground zero (or hopefully a lovely organized script).

The Multy Knob Changer is a simple script, that lets you change several same knobs in a selection of nodes.

how to use:

Let’s say you want to set the ‘size’ knob of all blur nodes in the script to ’42’.

  • copy paste the script code into your nuke script editor and run it
  • enter the node class name, knob name and select the knob type (e.g. text field, drop down menu, check box)
  • check ‘only selected nodes’, if you don’t want to set the knob values for all nodes in the script
  • hit the start button

MKC_UI_01

  • enter your new value, press ok. Et voilĂ , all your blur nodes were updated.

MKC_UI_02

Get the script here.

If you want to add the script to your nuke menu and toolbar, place the multyKnobChanger.py in your .nuke folder and add the following lines to your menu.py. Don’t forget to comment out the last line (‘mainFunction()’) in the script.
For more details on custom menues check out this Nukepedia article.

import multyKnobChanger
effectropyTools = nuke.menu('Nodes').addMenu('effectropyTools')
effectropyTools.addCommand('multyKnobChanger', 'multyKnobChanger.mainFunction()')

menuBar = nuke.menu('Nuke')
menuBar.addCommand('Edit/multyKnobChanger', 'multyKnobChanger.mainFunction()')
Advertisements


Leave a comment

Nuke copy pasta #001 : custom light wrap

Nuke is the compositing software we all use and love. The nuke copy pasta series is a collection of useful, every day setups. Copy, paste, have fun! Let’s start with a simple light wrap.

teapot_lw_compare

Nuke has a built in light wrap tool, which is quick and easy to use. However sometimes it is more convenient to built an own light wrap, giving a lot more flexibility.

Here is a basic setup:
custom_light_wrap_script

You can copy paste the code below, or download the nuke script (images included).

set cut_paste_input [stack 0]
version 6.3 v1
BackdropNode {
inputs 0
name BackdropNode1
label "light wrap"
note_font_size 33
selected true
xpos -1035
ypos -381
bdwidth 322
bdheight 484
}
push 0
NoOp {
label "FG\nwith alpha"
selected true
xpos -1139
ypos 32
}
Dot {
name Dot2
selected true
xpos -1009
ypos 41
}
set N5f520c0 [stack 0]
Dot {
name Dot12
selected true
xpos -1009
ypos 124
}
set N21fe6df0 [stack 0]
EdgeDetectWrapper {
channels alpha
erodesize 1
name EdgeDetectWrapper3
selected true
xpos -1043
ypos 194
}
push $N21fe6df0
Dot {
name Dot6
selected true
xpos -674
ypos 124
}
RotoPaint {
inputs 0
curves {AnimTree: "" {
Version: 1.2
Flag: 0
RootNode: 1
Node: {
NodeName: "Root" {
Flag: 512
NodeType: 1
Transform: 0 0 S 0 0 S 0 0 S 0 0 S 0 1 S 0 1 S 0 0 S 0 1024 S 0 778
NumOfAttributes: 10
"vis" S 0 1 "opc" S 0 1 "mbo" S 0 1 "mb" S 0 1 "mbs" S 0 0.5 "fo" S 0 1 "fx" S 0 0 "fy" S 0 0 "ff" S 0 1 "ft" S 0 0
}
NumOfChildren: 1
Node: {
NodeName: "Rectangle1" {
Flag: 576
NodeType: 3
CurveGroup: "" {
Transform: 0 0 S 1 1 0 S 1 1 0 S 1 1 0 S 1 1 1 S 1 1 1 S 1 1 0 S 1 1 1094 S 1 1 349.5
Flag: 0
NumOfCubicCurves: 2
CubicCurve: "" {
Type: 0 Flag: 8192 Dim: 2
NumOfPoints: 12
1 S 1 1 0 S 1 1 -296.333 0 1 S 1 1 670 S 1 1 796.4 0 1 S 1 1 290.667 S 1 1 0 0 1 S 1 1 -290.667 S 1 1 0 0 1 S 1 1 1530 S 1 1 794 0 1 S 1 1 0 S 1 1 -296.333 0 1 S 1 1 0 S 1 1 296.333 0 1 S 1 1 1530 S 1 1 -95 0 1 S 1 1 -290.667 S 1 1 0 0 1 S 1 1 290.667 S 1 1 0 0 1 S 1 1 670 S 1 1 -92.6 0 1 S 1 1 0 S 1 1 296.333 0
}
CubicCurve: "" {
Type: 0 Flag: 8192 Dim: 2
NumOfPoints: 12
1 S 1 1 0 S 1 1 -296.333 0 1 S 1 1 0 S 1 1 0 0 1 S 1 1 290.667 S 1 1 0 0 1 S 1 1 -290.667 S 1 1 0 0 1 S 1 1 0 S 1 1 0 0 1 S 1 1 0 S 1 1 -296.333 0 1 S 1 1 0 S 1 1 296.333 0 1 S 1 1 0 S 1 1 0 0 1 S 1 1 -290.667 S 1 1 0 0 1 S 1 1 290.667 S 1 1 0 0 1 S 1 1 0 S 1 1 0 0 1 S 1 1 0 S 1 1 296.333 0
}
NumOfAttributes: 43
"vis" S 0 1 "r" S 0 1 "g" S 0 1 "b" S 0 1 "a" S 0 1 "ro" S 0 0 "go" S 0 0 "bo" S 0 0 "ao" S 0 0 "opc" S 0 1 "bm" S 0 0 "inv" S 0 0 "mbo" S 0 0 "mb" S 0 1 "mbs" S 0 0.5 "mbsot" S 0 0 "mbso" S 0 0 "fo" S 0 1 "fx" S 0 0 "fy" S 0 0 "ff" S 0 1 "ft" S 0 0 "src" S 0 0 "stx" S 0 0 "sty" S 0 0 "str" S 0 0 "sr" S 0 0 "ssx" S 0 1 "ssy" S 0 1 "ss" S 0 0 "spx" S 0 1024 "spy" S 0 778 "stot" S 0 0 "sto" S 0 0 "sv" S 0 0 "sf" S 0 1 "sb" S 0 1 "nv" S 0 1 "view1" S 0 1 "ltn" S 0 1 "ltm" S 0 1 "ltt" S 0 0 "tt" S 0 7
}
}
NumOfChildren: 0
}
}
}
}
toolbox {selectAll {
{ selectAll ssx 1 ssy 1 sf 1 }
{ createBezier ssx 1 ssy 1 sf 1 sb 1 tt 4 }
{ createBSpline ssx 1 ssy 1 sf 1 sb 1 }
{ createEllipse ssx 1 ssy 1 sf 1 sb 1 }
{ createRectangle ssx 1 ssy 1 sf 1 sb 1 tt 7 }
{ brush ssx 1 ssy 1 sf 1 sb 1 }
{ eraser src 2 ssx 1 ssy 1 sf 1 sb 1 }
{ clone src 1 ssx 1 ssy 1 sf 1 sb 1 }
{ reveal src 3 ssx 1 ssy 1 sf 1 sb 1 }
{ dodge src 1 ssx 1 ssy 1 sf 1 sb 1 }
{ burn src 1 ssx 1 ssy 1 sf 1 sb 1 }
{ blur src 1 ssx 1 ssy 1 sf 1 sb 1 }
{ sharpen src 1 ssx 1 ssy 1 sf 1 sb 1 }
{ smear src 1 ssx 1 ssy 1 sf 1 sb 1 }
} }
toolbar_brush_hardness 0.200000003
toolbar_lifetime_type all
toolbar_source_transform_scale {1 1}
toolbar_source_transform_center {320 240}
colorOverlay 0
lifetime_type "all frames"
motionblur_shutter_offset_type centred
source_black_outside true
name RotoPaint1
selected true
xpos -975
ypos -22
}
push $N5f520c0
Dot {
name Dot5
selected true
xpos -1009
ypos -114
}
set N5f523f0 [stack 0]
Keyer {
invert true
operation "luminance key"
range {0.01773313805 0.08494734981 1 1}
name Keyer1
selected true
xpos -975
ypos -124
}
Blur {
size 4.8
name Blur6
selected true
xpos -975
ypos -88
}
push $N5f523f0
Dot {
name Dot7
selected true
xpos -1009
ypos -226
}
set N5f52a50 [stack 0]
EdgeDetectWrapper {
channels alpha
erodesize 1.2
name EdgeDetectWrapper2
selected true
xpos -968
ypos -235
}
Blur {
size 8
name Blur3
selected true
xpos -968
ypos -198
}
Dot {
name Dot8
label "\n\nfine lw matte"
selected true
xpos -934
ypos -156
}
push $N5f52a50
Dot {
name Dot3
selected true
xpos -1009
ypos -302
}
EdgeDetectWrapper {
channels {-rgba.red -rgba.green -rgba.blue rgba.alpha}
erodesize -3
name EdgeDetectWrapper1
selected true
xpos -865
ypos -311
}
Blur {
size 16.4
name Blur2
selected true
xpos -865
ypos -273
}
Dot {
name Dot4
label "big lw matte"
selected true
xpos -831
ypos -233
}
Merge2 {
inputs 2
operation plus
mix 0.725
name Merge4
selected true
xpos -865
ypos -159
}
Grade {
inputs 1+1
channels alpha
white 0.63
name Grade1
selected true
xpos -865
ypos -88
}
set N16306f00 [stack 0]
Merge2 {
inputs 2
operation stencil
name Merge3
selected true
xpos -865
ypos -22
disable true
}
set N16307230 [stack 0]
push $cut_paste_input
NoOp {
label "BG\n"
selected true
xpos -514
ypos -317
}
Dot {
name Dot1
selected true
xpos -480
ypos -41
}
set N16307890 [stack 0]
Blur {
size 36.5
name Blur1
selected true
xpos -621
ypos -50
}
Dot {
name Dot11
label "blurred bg"
selected true
xpos -587
ypos -14
}
push $N5f520c0
Merge2 {
inputs 2+1
operation plus
mix 0.57
name Merge2
selected true
xpos -865
ypos 37
}
set N16307ef0 [stack 0]
ShuffleCopy {
inputs 2
name ShuffleCopy1
selected true
xpos -708
ypos 37
}
Premult {
name Premult2
selected true
xpos -611
ypos 37
}
push $N16307890
Merge2 {
inputs 2
name Merge1
selected true
xpos -514
ypos 37
}
set N16308ee0 [stack 0]
Blur {
inputs 1+1
size 2
mix 0.625
name Blur4
selected true
xpos -514
ypos 194
}
Dot {
name Dot13
label "slight edge blur\n(be careful with grain)"
selected true
xpos -415
ypos 203
}
push $N16308ee0
Dot {
name Dot14
label "fg over bg"
selected true
xpos -404
ypos 40
}
push $N16307ef0
Dot {
name Dot15
label "plus edge blur\nover fg"
selected true
xpos -831
ypos 76
}
push $N16307230
Dot {
name Dot10
label "mask out area"
selected true
xpos -762
ypos -19
}
push $N16306f00
Dot {
name Dot9
label "reduce lw in dark areas"
selected true
xpos -762
ypos -79
}