顯示具有 Nuke 標籤的文章。 顯示所有文章
顯示具有 Nuke 標籤的文章。 顯示所有文章

2014年2月20日 星期四

2014年2月10日 星期一

switch nuke channel by expression node






















set cut_paste_input [stack 0]
version 7.0 v10
ColorWheel {
 inputs 0
 gamma 0.45
 name ColorWheel2
 selected true
 xpos -68
 ypos -329
}
CheckerBoard2 {
 inputs 0
 name CheckerBoard3
 selected true
 xpos -191
 ypos -331
}
add_layer {JimmyChannel JimmyChannel.red JimmyChannel.green JimmyChannel.blue JimmyChannel.alpha}
ShuffleCopy {
 inputs 2
 alpha alpha2
 black red
 white green
 red2 blue
 green2 alpha
 out2 JimmyChannel
 name ShuffleCopy4
 label "模擬同一串流裡面有一組channel叫\nJimmyChannel"
 note_font_size 20
 selected true
 xpos -139
 ypos -217
}
Expression {
 channel0 {forward.u -forward.v -backward.u -backward.v}
 expr0 JimmyChannel.red
 channel1 {-forward.u forward.v -backward.u -backward.v}
 expr1 JimmyChannel.green
 channel2 {-forward.u -forward.v backward.u -backward.v}
 expr2 JimmyChannel.blue
 channel3 {-forward.u -forward.v -backward.u backward.v}
 expr3 JimmyChannel.alpha
 name Expression9
 label "將JimmyChannel切換到motion channel"
 note_font_size 20
 selected true
 xpos -139
 ypos -94
}


useful info about nuke expression node : http://www.nukepedia.com/written-tutorials/expressions-101
and thanks seadog's help!

2014年2月8日 星期六

shuffle-out-all-channels Script

http://www.muttsy.net/blog/2011/10/20/shuffle-out-all-channels/

nodes = nuke.selectedNodes()
for node in nodes:
 if node.Class() == 'Read':
  channels = node.channels()
  layers = list( set([channel.split('.')[0] for channel in channels]) )
  layers.sort()
  if 'rgba' in layers:
   layers.remove('rgba')
  for layer in layers:
   shuffleNode = nuke.nodes.Shuffle(label=layer,inputs=[node])
   shuffleNode['in'].setValue( layer )
   shuffleNode['postage_stamp'].setValue(True)
 else:
  pass

2014年1月15日 星期三

mask3d node

set cut_paste_input [stack 0]
version 7.0 v10
push $cut_paste_input
Group {
 name mask3d
 selected true
 xpos 1457
 ypos -418
 addUserKnob {20 User}
 addUserKnob {18 pos l Position t "Select the colour that corresponds to the position you want."}
 pos {5.994726658 48.59552765 6.745039463}
 addUserKnob {13 rad l Radius}
 rad {0.7 {rad.x} {rad.x}}
 addUserKnob {7 fall l "Falloff Exponent" R 1 10}
 fall 3.25
 addUserKnob {7 gain l Hardness}
 gain 0.54
}
 Input {
  inputs 0
  name __POS_INPUT__
  xpos 95
  ypos 536
 }
 Expression {
  temp_name0 distR
  temp_expr0 (Br-parent.pos.r)/rad.x
  temp_name1 distG
  temp_expr1 (Bg-parent.pos.g)/rad.y
  temp_name2 distB
  temp_expr2 (Bb-parent.pos.b)/rad.z
  temp_name3 len
  temp_expr3 sqrt((distR*distR)+(distG*distG)+(distB*distB))
  expr0 pow(1-len,fall)
  expr1 pow(1-len,fall)
  expr2 pow(1-len,fall)
  expr3 pow(1-len,fall)
  name __POSITION_KEY__
  xpos 95
  ypos 597
 }
 Clamp {
  channels rgba
  name Clamp1
  xpos 95
  ypos 641
 }
 Group {
  name Perlin_gain
  help "This is an implementation of Ken Perlin's gain function. It boosts micro-contrast (acutance, in photographic terms) without clipping. When set to 0.5, it has no effect. When >0.5, gain is boosted; when <.5, gain is muted. Only luminance is affected; not hue nor saturation. Superwhites remain untouched."
  tile_color 0xcc9d6d00
  xpos 95
  ypos 686
  addUserKnob {20 "" l User}
  addUserKnob {7 realGain l "Perlin Gain function" t "This is an implementation of Ken Perlin's gain function. It boosts micro-contrast (acutance, in photographic terms) without clipping. When set to 0.5, it has no effect. When >0.5, gain is boosted; when <.5, gain is muted. Only luminance is affected; not hue nor saturation. Superwhites remain untouched."}
  realGain {{parent.gain}}
 }
  Input {
   inputs 0
   name Input1
   selected true
   xpos 130
   ypos -89
  }
  Expression {
   temp_name0 gain
   temp_expr0 parent.realGain
   temp_name1 lum
   temp_expr1 "0.2125*Br + 0.7154*Bg + 0.0721*Bb"
   temp_name2 val
   temp_expr2 .5*((lum<.5)?((1-gain)>0?pow(2*lum,log(1-gain)/log(0.5)):0):2-((1-gain)>0?pow(2-2*lum,log(1-gain)/log(0.5)):0))
   expr0 r>1?r:r*(val/(lum+0.00001))
   expr1 g>1?g:g*(val/(lum+0.00001))
   expr2 b>1?b:b*(val/(lum+0.00001))
   name KPGain
   tile_color 0xd47f3b00
   label "TRUE GAIN\nFUNCTION"
   xpos 130
   ypos -24
   addUserKnob {20 "" l User}
  }
  Output {
   name Output1
   xpos 130
   ypos 98
  }
 end_group
 Clamp {
  channels rgba
  name Clamp2
  selected true
  xpos 95
  ypos 731
 }
 Output {
  name Output1
  xpos 95
  ypos 839
 }
end_group

2013年3月18日 星期一

2012年10月16日 星期二

Nuke useful SliceTool

set cut_paste_input [stack 0]
version 6.3 v4
push $cut_paste_input
Group {
 name SliceTool39
 selected true
 xpos -625
 ypos -93
 addUserKnob {20 SliceTool}
 addUserKnob {4 output M {Over Right Left Top Bottom}}
 output Right
 addUserKnob {7 scanlinePosition l "scanline position"}
 scanlinePosition 0.5
 addUserKnob {20 settings l Settings}
 addUserKnob {7 thickness l "curve thickness"}
 thickness 0.5
 addUserKnob {7 scanlineThickness l "scanline thickness" R 1 10}
 scanlineThickness 5
 addUserKnob {12 pos1 l INVISIBLE +INVISIBLE}
 pos1 {0 {int(input.format.h*scanlinePosition)}}
 addUserKnob {12 pos2 l INVISIBLE +INVISIBLE}
 pos2 {{input.format.w} {pos1.y}}
}
 Input {
  inputs 0
  name Input
  xpos -535
  ypos -261
 }
set Na1d2e00 [stack 0]
 Transform {
  translate {{-parent.pos1 i} {-parent.pos1 i}}
  black_outside false
  name Transform4
  label T
  xpos -535
  ypos -231
 }
 Transform {
  rotate {{"-degrees( atan2(parent.pos2.y-parent.pos1.y, parent.pos2.x-parent.pos1.x) )" i}}
  black_outside false
  name Transform5
  label "R\n"
  xpos -535
  ypos -197
 }
 Transform {
  scale {{"width / sqrt(pow(parent.pos2.x-parent.pos1.x,2) + pow(parent.pos2.y-parent.pos1.y,2))" i}}
  black_outside false
  name Transform6
  label S
  xpos -535
  ypos -160
 }
 Crop {
  box {0 0 {Input.width i} 1}
  reformat true
  crop false
  name Crop1
  xpos -536
  ypos -117
 }
 Reformat {
  type "to box"
  box_width {{Input.width i}}
  box_height {{Input.height i}}
  box_fixed true
  resize distort
  filter Impulse
  name Reformat1
  xpos -536
  ypos -92
 }
 Expression {
  expr0 "fabs((y/height)-r)<=tolerance ? 1 : 0"
  expr1 "fabs((y/height)-g)<=tolerance ? 1 : 0"
  expr2 "fabs((y/height)-b)<=tolerance ? 1 : 0"
  name Expression3
  xpos -533
  ypos -51
  addUserKnob {20 User}
  addUserKnob {7 tolerance}
  tolerance {{parent.thickness/100 i}}
 }
set Na33b6b0 [stack 0]
 Dot {
  name Dot3
  xpos -163
  ypos -48
 }
set Na33b9e0 [stack 0]
 Dot {
  name Dot4
  xpos -62
  ypos -48
 }
set Na33bd10 [stack 0]
 Dot {
  name Dot6
  xpos 37
  ypos -48
 }
set Na33c040 [stack 0]
 Dot {
  name Dot9
  xpos 159
  ypos -48
 }
 Constant {
  inputs 0
  channels rgb
  color {100 100 -100 0}
  name Constant1
  xpos -360
  ypos -399
 }
 Reformat {
  type "to box"
  box_width {{Input.format.w i}}
  box_height {{int(parent.scanlineThickness) i}}
  box_fixed true
  resize distort
  center false
  filter Impulse
  name Reformat2
  xpos -360
  ypos -333
 }
 Transform {
  translate {0 {-int((parent.scanlineThickness/2)*parent.scanlinePosition) i}}
  center {1024 1.5}
  filter Impulse
  name Transform2
  xpos -360
  ypos -315
 }
 Transform {
  translate {{parent.pos1 i} {parent.pos1-int((parent.scanlineThickness*parent.scanlinePosition)+(Transform2.translate.y*parent.scanlinePosition)) i}}
  center {1024 0.5}
  name Transform1
  xpos -360
  ypos -297
 }
push $Na1d2e00
 Merge2 {
  inputs 2
  name Merge2
  xpos -360
  ypos -261
 }
 Dot {
  name Dot2
  xpos -237
  ypos -256
 }
set Na33d690 [stack 0]
 Dot {
  name Dot1
  xpos -119
  ypos -256
 }
set Na33d9c0 [stack 0]
 Dot {
  name Dot5
  xpos -6
  ypos -256
 }
set Na33dcf0 [stack 0]
 Dot {
  name Dot8
  xpos 104
  ypos -256
 }
set Na33e020 [stack 0]
 Dot {
  name Dot7
  xpos 220
  ypos -256
 }
 ContactSheet {
  inputs 2
  width {{Input.width i}}
  height {{Input.height*2 i}}
  rows 2
  columns 1
  roworder TopBottom
  name ContactSheet2
  xpos 186
  ypos -27
 }
push $Na33c040
push $Na33e020
 ContactSheet {
  inputs 2
  width {{Input.width i}}
  height {{Input.height*2 i}}
  rows 2
  columns 1
  name ContactSheet3
  xpos 74
  ypos -25
 }
push $Na33bd10
push $Na33dcf0
 ContactSheet {
  inputs 2
  width {{Input.width*2 i}}
  height {{Input.height i}}
  rows 1
  columns 2
  colorder RightLeft
  name ContactSheet4
  xpos -40
  ypos -22
 }
push $Na33b9e0
push $Na33d9c0
 ContactSheet {
  inputs 2
  width {{Input.width*2 i}}
  height {{Input.height i}}
  rows 1
  columns 2
  name ContactSheet1
  xpos -153
  ypos -21
 }
push $Na33b6b0
push $Na33b6b0
 ChannelMerge {
  inputs 2
  A rgba.red
  B rgba.green
  name ChannelMerge1
  xpos -533
  ypos 16
 }
set Na3dddb0 [stack 0]
push $Na3dddb0
 ChannelMerge {
  inputs 2
  B rgba.blue
  name ChannelMerge2
  xpos -533
  ypos 84
 }
push $Na33d690
 Merge2 {
  inputs 2
  name Merge1
  xpos -268
  ypos 95
 }
 Switch {
  inputs 5
  which {{parent.output i}}
  name Switch1
  xpos -150
  ypos 95
 }
 Output {
  name Output1
  xpos -150
  ypos 153
 }
end_group

2012年5月23日 星期三

Nuke & ARRI ALEXA color management!


Color profile need to be add in init.py
--------------------------------------------------------------------------------------------------------
#custom input/output LUTs
nuke.root().knob('luts').addCurve("AlexaV3LogC", "{ (t > 0.1496582 ? pow(10.0, (t - 0.385537) / 0.2471896) : t / 0.9661776 - 0.04378604) * 0.18 - 0.00937677 }")

# ViewerProcess LUTs
nuke.ViewerProcess.register("AlexaV3Rec709",nuke.createNode,("Vectorfield", "vfield_file C:/luts/AlexaV3_K1S1_LogC2Video_Rec709_EE_nuke3d.cube colorspaceIn AlexaV3LogC"))

--------------------------------------------------------------------------------------------------------

Sample init.py

ARRI ALEXA Lut generator link!

2012年5月2日 星期三

2012年2月18日 星期六

2012年2月13日 星期一

Nuke stuff that easy to forget!

[file dirname [value root.name]]/source/yourFootage.tif


2012年1月30日 星期一

2012年1月17日 星期二

2011年10月18日 星期二

2011年6月7日 星期二

2011年5月12日 星期四

2011年2月21日 星期一

motion vector from Maya render pass

Motion Vectors - Example II from Sagroth on Vimeo.

And the Sigillarium Blog

Quick note:

1: Add a "Normalized 2d motion vector" pass in render setting, and set normalized 2d motion vector > Render Pass Parameters > Max Pixel Diap. (your render images width size, but 1024 is max), Filter is ON!

2: In render setting > Motion Blur > Motion offset to 0

3: render quality is 4x32bit float!

2011年1月8日 星期六

linear color workflow in Maya shader


Base on eat3D training setting mia_exposure_simple

set Knee: 1.0/ Compression: 0/ Gamma: 2.2

it works exactly like nuke's LUT function, good for render out some color pass such (beauty/ diff/ spec/ refl/ refr/ sss/ oc...etc), if you output format is gamma 2.2(sRGB)'s Tiff/ TGA..etc, you will need to leave "mia_exposure_simple" on and set gamma 2.2 to render. But if output format is EXR in linear color space, you might set "mia_exposure_simple" gamma to 1.0
Well! personal feel you will need to break mia_exposure_simple from maya camera, since this node does some strange result on RGB color matte (darker color)/ Point in space render (points become all flat, no depth) what I discover recently.....

and the Final, Great thanks Stu / Zap and Kuan Lin..... who inspire me all the linear workflow

what is ChromAberration?????

ChromAberration training from http://maltaannon.com