在Nuke中制作滤波器信号波动效果的两种方法
程序员文章站
2024-03-18 13:09:04
...
在Nuke中制作滤波器信号波动效果的两种方法
当下,Hologram全息效果在影视后期的效果越来越常见。下面笔者将介绍在Nuke中的两种制作思路,希望能给大家带来帮助:
- 首先,笔者将使用Ramp节点制作一个颜色丰富和动态变化的序列。当然,大家可以直接使用需要制作成Hologram全息效果的镜头。在这里笔者之所以特意把这点强调说明是因为想和大家分享下在Nuke中制作彩虹条的方法:
01):使用Shuffle节点将Ramp节点的g和b通道变为1;
02):使用Colorspace节点转换色彩空间:in HSV,out:Linear;
图一:使用Ramp节点生成的渐变图
图二:通过以上方法得到的彩虹条效果
- 其次,添加Multiply节点并在其value属性控件写入表达式:abs(sin(frame*80))*1.5,以添加画面亮度随机紊乱变化效果;
- 最后,使用X_Waveform和PlotScanline gizmo 节点对画面添加Hologram全息效果;
图三:X_Waveform gizmo 节点模拟效果
图四:PlotScanline gizmo 节点模拟效果
当然,大家还可以通过调节X_Waveform和PlotScanline gizmo 节点的属性获得更多效果。
Nuke脚本文件分享如下:
set cut_paste_input [stack 0]
version 10.5 v5
BackdropNode {
inputs 0
name BackdropNode1
tile_color 0x252327ff
label "Wavefilter Motiongraphic_FX"
note_font "Bitstream Vera Sans Bold Bold Bold"
note_font_size 30
selected true
xpos -1209
ypos -474
bdwidth 493
bdheight 693
addUserKnob {20 mainTabTK l backdropTK}
addUserKnob {41 label_1 l label T BackdropNode1.label}
addUserKnob {22 rndClrs0 l "<font style=\"background-color:#3e4f5a\"> <img size=\"8\" src=\"Shaders.png\"> CG </font>" T "import colorsys\nn=nuke.thisNode()\nlist=\[u' CG ', u' FX ', u' 3D ', u' Key ', u'Cleanup', u' Ref ', u' Pub ', u'Important!']\nn\['icon'].setValue('Shaders.png')\nR,G,B= \[0.567, 0.301, 0.353]\nR,G,B=colorsys.hsv_to_rgb(R,G,B)\nn\['tile_color'].setValue( int('%02x%02x%02x%02x' % (R*255,G*255,B*255,255), 16 ))\nif ((n\['label'].getValue()=='') or (n\['label'].getValue() in list)):\n n\['label'].setValue(' CG ')\n\nallnodes=nuke.allNodes()\nlist=\[]\nnd_name='%s_backdrop' % ' CG '\ncurName=n\['name'].getValue().split(nd_name)\n\nif ((len(curName)>0) and (not curName\[0]=='')):\n for nd in allnodes:\n splt=nd.name().split(nd_name)\n if (len(splt)>1):\n num=splt\[1]\n if num.isdigit():\n list.append(int(num))\n if len(list)>0:\n next=int(sorted(list)\[-1])+1 \n else: next=1\n n\['name'].setValue('%s%s' % (nd_name,next))" +STARTLINE}
addUserKnob {22 rndClrs1 l "<font style=\"background-color:#3d3228\"> <img size=\"8\" src=\"Light.png\"> FX </font>" -STARTLINE T "import colorsys\nn=nuke.thisNode()\nlist=\[u' CG ', u' FX ', u' 3D ', u' Key ', u'Cleanup', u' Ref ', u' Pub ', u'Important!']\nn\['icon'].setValue('Light.png')\nR,G,B= \[0.079, 0.34, 0.242]\nR,G,B=colorsys.hsv_to_rgb(R,G,B)\nn\['tile_color'].setValue( int('%02x%02x%02x%02x' % (R*255,G*255,B*255,255), 16 ))\nif ((n\['label'].getValue()=='') or (n\['label'].getValue() in list)):\n n\['label'].setValue(' FX ')\n\nallnodes=nuke.allNodes()\nlist=\[]\nnd_name='%s_backdrop' % ' FX '\ncurName=n\['name'].getValue().split(nd_name)\n\nif ((len(curName)>0) and (not curName\[0]=='')):\n for nd in allnodes:\n splt=nd.name().split(nd_name)\n if (len(splt)>1):\n num=splt\[1]\n if num.isdigit():\n list.append(int(num))\n if len(list)>0:\n next=int(sorted(list)\[-1])+1 \n else: next=1\n n\['name'].setValue('%s%s' % (nd_name,next))"}
addUserKnob {22 rndClrs2 l "<font style=\"background-color:#2e202f\"> <img size=\"8\" src=\"Geometry.png\"> 3D </font>" -STARTLINE T "import colorsys\nn=nuke.thisNode()\nlist=\[u' CG ', u' FX ', u' 3D ', u' Key ', u'Cleanup', u' Ref ', u' Pub ', u'Important!']\nn\['icon'].setValue('Geometry.png')\nR,G,B= \[0.822, 0.312, 0.188]\nR,G,B=colorsys.hsv_to_rgb(R,G,B)\nn\['tile_color'].setValue( int('%02x%02x%02x%02x' % (R*255,G*255,B*255,255), 16 ))\nif ((n\['label'].getValue()=='') or (n\['label'].getValue() in list)):\n n\['label'].setValue(' 3D ')\n\nallnodes=nuke.allNodes()\nlist=\[]\nnd_name='%s_backdrop' % ' 3D '\ncurName=n\['name'].getValue().split(nd_name)\n\nif ((len(curName)>0) and (not curName\[0]=='')):\n for nd in allnodes:\n splt=nd.name().split(nd_name)\n if (len(splt)>1):\n num=splt\[1]\n if num.isdigit():\n list.append(int(num))\n if len(list)>0:\n next=int(sorted(list)\[-1])+1 \n else: next=1\n n\['name'].setValue('%s%s' % (nd_name,next))"}
addUserKnob {22 rndClrs3 l "<font style=\"background-color:#384937\"> <img size=\"8\" src=\"Keyer.png\"> Key </font>" -STARTLINE T "import colorsys\nn=nuke.thisNode()\nlist=\[u' CG ', u' FX ', u' 3D ', u' Key ', u'Cleanup', u' Ref ', u' Pub ', u'Important!']\nn\['icon'].setValue('Keyer.png')\nR,G,B= \[0.333, 0.243, 0.29]\nR,G,B=colorsys.hsv_to_rgb(R,G,B)\nn\['tile_color'].setValue( int('%02x%02x%02x%02x' % (R*255,G*255,B*255,255), 16 ))\nif ((n\['label'].getValue()=='') or (n\['label'].getValue() in list)):\n n\['label'].setValue(' Key ')\n\nallnodes=nuke.allNodes()\nlist=\[]\nnd_name='%s_backdrop' % ' Key '\ncurName=n\['name'].getValue().split(nd_name)\n\nif ((len(curName)>0) and (not curName\[0]=='')):\n for nd in allnodes:\n splt=nd.name().split(nd_name)\n if (len(splt)>1):\n num=splt\[1]\n if num.isdigit():\n list.append(int(num))\n if len(list)>0:\n next=int(sorted(list)\[-1])+1 \n else: next=1\n n\['name'].setValue('%s%s' % (nd_name,next))"}
addUserKnob {22 rndClrs4 l "<font style=\"background-color:#403b52\"> <img size=\"8\" src=\"FloodFill.png\">Cleanup</font>" -STARTLINE T "import colorsys\nn=nuke.thisNode()\nlist=\[u' CG ', u' FX ', u' 3D ', u' Key ', u'Cleanup', u' Ref ', u' Pub ', u'Important!']\nn\['icon'].setValue('FloodFill.png')\nR,G,B= \[0.703, 0.28, 0.322]\nR,G,B=colorsys.hsv_to_rgb(R,G,B)\nn\['tile_color'].setValue( int('%02x%02x%02x%02x' % (R*255,G*255,B*255,255), 16 ))\nif ((n\['label'].getValue()=='') or (n\['label'].getValue() in list)):\n n\['label'].setValue('Cleanup')\n\nallnodes=nuke.allNodes()\nlist=\[]\nnd_name='%s_backdrop' % 'Cleanup'\ncurName=n\['name'].getValue().split(nd_name)\n\nif ((len(curName)>0) and (not curName\[0]=='')):\n for nd in allnodes:\n splt=nd.name().split(nd_name)\n if (len(splt)>1):\n num=splt\[1]\n if num.isdigit():\n list.append(int(num))\n if len(list)>0:\n next=int(sorted(list)\[-1])+1 \n else: next=1\n n\['name'].setValue('%s%s' % (nd_name,next))"}
addUserKnob {22 rndClrs5 l "<font style=\"background-color:#787048\"> <img size=\"8\" src=\"Read.png\"> Ref </font>" -STARTLINE T "import colorsys\nn=nuke.thisNode()\nlist=\[u' CG ', u' FX ', u' 3D ', u' Key ', u'Cleanup', u' Ref ', u' Pub ', u'Important!']\nn\['icon'].setValue('Read.png')\nR,G,B= \[0.138, 0.404, 0.474]\nR,G,B=colorsys.hsv_to_rgb(R,G,B)\nn\['tile_color'].setValue( int('%02x%02x%02x%02x' % (R*255,G*255,B*255,255), 16 ))\nif ((n\['label'].getValue()=='') or (n\['label'].getValue() in list)):\n n\['label'].setValue(' Ref ')\n\nallnodes=nuke.allNodes()\nlist=\[]\nnd_name='%s_backdrop' % ' Ref '\ncurName=n\['name'].getValue().split(nd_name)\n\nif ((len(curName)>0) and (not curName\[0]=='')):\n for nd in allnodes:\n splt=nd.name().split(nd_name)\n if (len(splt)>1):\n num=splt\[1]\n if num.isdigit():\n list.append(int(num))\n if len(list)>0:\n next=int(sorted(list)\[-1])+1 \n else: next=1\n n\['name'].setValue('%s%s' % (nd_name,next))"}
addUserKnob {22 rndClrs6 l "<font style=\"background-color:#67754a\"> <img size=\"8\" src=\"Vectorfield.png\"> Pub </font>" -STARTLINE T "import colorsys\nn=nuke.thisNode()\nlist=\[u' CG ', u' FX ', u' 3D ', u' Key ', u'Cleanup', u' Ref ', u' Pub ', u'Important!']\nn\['icon'].setValue('Vectorfield.png')\nR,G,B= \[0.221, 0.368, 0.46]\nR,G,B=colorsys.hsv_to_rgb(R,G,B)\nn\['tile_color'].setValue( int('%02x%02x%02x%02x' % (R*255,G*255,B*255,255), 16 ))\nif ((n\['label'].getValue()=='') or (n\['label'].getValue() in list)):\n n\['label'].setValue(' Pub ')\n\nallnodes=nuke.allNodes()\nlist=\[]\nnd_name='%s_backdrop' % ' Pub '\ncurName=n\['name'].getValue().split(nd_name)\n\nif ((len(curName)>0) and (not curName\[0]=='')):\n for nd in allnodes:\n splt=nd.name().split(nd_name)\n if (len(splt)>1):\n num=splt\[1]\n if num.isdigit():\n list.append(int(num))\n if len(list)>0:\n next=int(sorted(list)\[-1])+1 \n else: next=1\n n\['name'].setValue('%s%s' % (nd_name,next))"}
addUserKnob {22 rndClrs7 l "<font style=\"background-color:#a65fcc\"> <img size=\"8\" src=\"Glow.png\">Important!</font>" T "import colorsys\nn=nuke.thisNode()\nlist=\[u' CG ', u' FX ', u' 3D ', u' Key ', u'Cleanup', u' Ref ', u' Pub ', u'Important!']\nn\['icon'].setValue('Glow.png')\nR,G,B= \[0.776, 0.533, 0.8]\nR,G,B=colorsys.hsv_to_rgb(R,G,B)\nn\['tile_color'].setValue( int('%02x%02x%02x%02x' % (R*255,G*255,B*255,255), 16 ))\nif ((n\['label'].getValue()=='') or (n\['label'].getValue() in list)):\n n\['label'].setValue('Important!')\n\nallnodes=nuke.allNodes()\nlist=\[]\nnd_name='%s_backdrop' % 'Important!'\ncurName=n\['name'].getValue().split(nd_name)\n\nif ((len(curName)>0) and (not curName\[0]=='')):\n for nd in allnodes:\n splt=nd.name().split(nd_name)\n if (len(splt)>1):\n num=splt\[1]\n if num.isdigit():\n list.append(int(num))\n if len(list)>0:\n next=int(sorted(list)\[-1])+1 \n else: next=1\n n\['name'].setValue('%s%s' % (nd_name,next))" +STARTLINE}
addUserKnob {22 rndColors l " <img src=\"ColorBars.png\">Randomize color " T "import colorsys, random\nn=nuke.thisNode()\nR,G,B= colorsys.hsv_to_rgb(random.random(),.1+random.random()*.15,.15+random.random()*.15)\nn\['tile_color'].setValue( int('%02x%02x%02x%02x' % (R*255,G*255,B*255,255), 16 ) )" +STARTLINE}
addUserKnob {22 rndTint l " <img src=\"HueShift.png\">Randomize tint " -STARTLINE T "import colorsys, random\nn=nuke.thisNode()\nV=int(n\['tile_color'].getValue())\nR = (0xFF & V >> 24) / 255.0\nG = (0xFF & V >> 16) / 255.0\nB = (0xFF & V >> 8) / 255.0\n\nR,G,B= colorsys.rgb_to_hsv(R,G,B)\n\nR,G,B= colorsys.hsv_to_rgb(R,.1+random.random()*.15,.15+random.random()*.15)\nn\['tile_color'].setValue( int('%02x%02x%02x%02x' % (R*255,G*255,B*255,255), 16 ) )"}
addUserKnob {22 grow l " <img src=\"MergeMin.png\">" -STARTLINE T "n=nuke.thisNode()\nautoBackdrop.Grow(n,50)"}
addUserKnob {22 shrink l " <img src=\"MergeMax.png\">" -STARTLINE T "n=nuke.thisNode()\nautoBackdrop.Shrink(n,50)"}
addUserKnob {20 version}
addUserKnob {26 nodeClass l Class: T backdropTK}
addUserKnob {26 nodeVersion l Version: T "v 2.1"}
addUserKnob {22 chHelp l "<img src=\":qrc/images/Help.png\"> HELP" t "Opens web page with tool's manual" -STARTLINE T "nukescripts.openurl.start (tk.getHelpUrl(nuke.thisNode()))"}
}
StickyNote {
inputs 0
name StickyNote1
label "<p align='center'><font size=\"50\" color=\"red\">PlotScanline</font></p><p align='left'></p><div align='centor'><font ></font></div>\n\n-01: add to original plate;\n\n-02: Normalize model\n\n-03: Plot as curve"
note_font "DejaVu Sans Bold Bold Bold Bold Bold Bold"
selected true
xpos -940
ypos -73
}
StickyNote {
inputs 0
name StickyNote3
label "<p align='center'><font size=\"50\" color=\"red\">X_Waveform</font></p><p align='left'></p><div align='centor'><font ></font></div>\n\n-01: has the quality control;\n\n-02: bg add guides;\n\n"
note_font "DejaVu Sans Bold Bold Bold Bold Bold"
selected true
xpos -1180
ypos -72
}
push $cut_paste_input
Ramp {
invert true
p0 {1816 196}
name Ramp2
selected true
xpos -1130
ypos -383
}
Shuffle {
green white
blue white
name Shuffle2
selected true
xpos -1130
ypos -345
}
Grade {
white {{curve x1 0.5 s0 x25 0.7 s0}}
name Grade1
selected true
xpos -1130
ypos -303
}
Colorspace {
colorspace_in HSV
name Colorspace2
selected true
xpos -1130
ypos -256
}
Noise {
size 150
zoffset {{frame/10}}
center {960 540}
name Noise1
selected true
xpos -1130
ypos -198
}
set Ne8478a0 [stack 0]
Dot {
name Dot1
selected true
xpos -848
ypos -194
}
Multiply {
value {{abs(sin(frame*80))*1.5}}
mix 0.25
name Multiply2
selected true
xpos -882
ypos 52
}
Group {
name PlotScanline2
selected true
xpos -882
ypos 100
addUserKnob {20 Controls}
addUserKnob {4 mode l "Sampling method" M {"Slice Per Pixel (faster)" "Slice Area (slower)" "Full Scanline" "" "" ""}}
mode "Full Scanline"
addUserKnob {6 add2image l "Add to original" +STARTLINE}
add2image true
addUserKnob {6 Normalize -STARTLINE}
addUserKnob {6 tonemap l "Tone Map (HDRI)" -STARTLINE}
addUserKnob {6 curve l "Plot as curve" +STARTLINE}
curve true
addUserKnob {3 curveFat l "Curve Thickness" -STARTLINE}
curveFat {{abs(sin(frame*180))}}
addUserKnob {3 sa l "Sample Area" t "Disabled when using pr pixel method."}
sa 5
addUserKnob {7 lift l Lift R -1 1}
addUserKnob {7 scale l Scale R 0 5}
scale 1
addUserKnob {26 ""}
addUserKnob {12 p1 l "Start Point"}
p1 {612 340}
addUserKnob {12 p2 l "End Point" -STARTLINE}
p2 {620 804}
addUserKnob {26 ""}
addUserKnob {26 "" l "About " T "Plot Scanline v0.4 | aaa@qq.com\nUse P1 to select your scanline and/or you start slice."}
}
Input {
inputs 0
name Input1
xpos -480
ypos 62
}
set N11309510 [stack 0]
Expression {
temp_name0 length
temp_expr0 sqrt(r*r+g*g+b*b)
expr0 r/length
expr1 g/length
expr2 b/length
name Normalize
xpos -480
ypos 108
disable {{1-parent.Normalize i}}
}
Expression {
expr0 r/(r+1)
expr1 g/(g+1)
expr2 b/(b+1)
name tonamap
xpos -480
ypos 134
disable {{1-parent.tonemap i}}
}
set N112fdc20 [stack 0]
Expression {
temp_name0 rExpr
temp_expr0 "min(max(0,\r\nceil(r(x,parent.p1.y)-((y/height+parent.lift)*parent.scale))),1)"
temp_name1 gExpr
temp_expr1 "min(max(0,\r\nceil(g(x,parent.p1.y)-((y/height+parent.lift)*parent.scale))),1)"
temp_name2 bExpr
temp_expr2 "min(max(0,\r\nceil(b(x,parent.p1.y)-((y/height+parent.lift)*parent.scale))),1)"
expr0 rExpr
expr1 gExpr
expr2 bExpr
expr3 0
name scanline
xpos -302
ypos 193
addUserKnob {20 User}
}
push $N112fdc20
Expression {
temp_name0 rExpr
temp_expr0 "min(max(0,\r\nceil(r((x/width)*(parent.p2.x-parent.p1.x)+parent.p1.x,(x/width)*(parent.p2.y-parent.p1.y)+parent.p1.y,parent.sa,parent.sa)-((y/height+parent.lift)*parent.scale))),1)"
temp_name1 gExpr
temp_expr1 "min(max(0,\r\nceil(g((x/width)*(parent.p2.x-parent.p1.x)+parent.p1.x,(x/width)*(parent.p2.y-parent.p1.y)+parent.p1.y,parent.sa,parent.sa)-((y/height+parent.lift)*parent.scale))),1)"
temp_name2 bExpr
temp_expr2 "min(max(0,\r\nceil(b((x/width)*(parent.p2.x-parent.p1.x)+parent.p1.x,(x/width)*(parent.p2.y-parent.p1.y)+parent.p1.y,parent.sa,parent.sa)-((y/height+parent.lift)*parent.scale))),1)"
expr0 rExpr
expr1 gExpr
expr2 bExpr
expr3 0
name Expression_highQuality
xpos -515
ypos 197
addUserKnob {20 User}
}
push $N112fdc20
Expression {
temp_name0 rExpr
temp_expr0 "min(max(0,\r\nceil(r((x/width)*(parent.p2.x-parent.p1.x)+parent.p1.x,(x/width)*(parent.p2.y-parent.p1.y)+parent.p1.y)-((y/height+parent.lift)*parent.scale))),1)"
temp_name1 gExpr
temp_expr1 "min(max(0,\r\nceil(g((x/width)*(parent.p2.x-parent.p1.x)+parent.p1.x,(x/width)*(parent.p2.y-parent.p1.y)+parent.p1.y)-((y/height+parent.lift)*parent.scale))),1)"
temp_name2 bExpr
temp_expr2 "min(max(0,\r\nceil(b((x/width)*(parent.p2.x-parent.p1.x)+parent.p1.x,(x/width)*(parent.p2.y-parent.p1.y)+parent.p1.y)-((y/height+parent.lift)*parent.scale))),1)"
expr0 rExpr
expr1 gExpr
expr2 bExpr
expr3 0
name perPixel
xpos -419
ypos 201
addUserKnob {20 User}
}
Switch {
inputs 3
which {{parent.mode i}}
name Switch2
xpos -480
ypos 253
}
Matrix {
matrix {
{0 1 0}
{1 -4 1}
{0 1 0}
}
name Matrix2
selected true
xpos -480
ypos 284
disable {{-1+parent.curve i x70 1}}
}
Dilate {
size {{parent.curveFat}}
name Dilate1
xpos -480
ypos 326
disable {{-1+parent.curve.main}}
}
Clamp {
name Clamp1
xpos -480
ypos 383
}
set N113e6340 [stack 0]
push $N11309510
Dot {
name Dot1
xpos -556
ypos 66
}
Clamp {
maximum 331
name Clamp2
xpos -590
ypos 352
}
Merge2 {
inputs 2
operation plus
bbox intersection
name Merge1
xpos -590
ypos 394
}
Dot {
name Dot2
xpos -556
ypos 433
}
push $N113e6340
Switch {
inputs 2
which {{parent.add2image i}}
name Switch1
xpos -480
ypos 425
}
Output {
name Output1
xpos -480
ypos 470
}
end_group
Reformat {
format "1350 450 0 0 1350 450 1 600*200"
clamp true
black_outside true
name Reformat1
selected true
xpos -882
ypos 137
}
push $Ne8478a0
Multiply {
value {{abs(sin(frame*80))*1.5}}
mix 0.25
name Multiply1
selected true
xpos -1130
ypos 61
}
X_Waveform.gizmo {
name X_Waveform1
selected true
xpos -1130
ypos 130
quality 1
size {1350 450}
}
Viewer {
frame_range 1-25
fps 25
name Viewer1
selected true
xpos -1130
ypos 156
addUserKnob {20 Lock}
addUserKnob {6 lock_all_buffers l "lock all buffers" -STARTLINE}
addUserKnob {6 lock_buffer_1 l "lock buffer 1" +STARTLINE}
addUserKnob {6 lock_buffer_2 l "lock buffer 2" +STARTLINE}
addUserKnob {6 lock_buffer_3 l "lock buffer 3" +STARTLINE}
addUserKnob {6 lock_buffer_4 l "lock buffer 4" +STARTLINE}
addUserKnob {6 lock_buffer_5 l "lock buffer 5" +STARTLINE}
addUserKnob {6 lock_buffer_6 l "lock buffer 6" +STARTLINE}
addUserKnob {6 lock_buffer_7 l "lock buffer 7" +STARTLINE}
addUserKnob {6 lock_buffer_8 l "lock buffer 8" +STARTLINE}
addUserKnob {6 lock_buffer_9 l "lock buffer 9" +STARTLINE}
addUserKnob {6 lock_buffer_0 l "lock buffer 0" +STARTLINE}
}
上一篇: CSS的color