Skip to content

Instantly share code, notes, and snippets.

@kpprt
Last active November 1, 2018 17:07
Show Gist options
  • Save kpprt/d947f0036253b7dfbeabefb7d75e5d6d to your computer and use it in GitHub Desktop.
Save kpprt/d947f0036253b7dfbeabefb7d75e5d6d to your computer and use it in GitHub Desktop.
Stabilize an image with the rotation of a 3D camera in Nuke. An additional axis input allows camera animations on top of the stabilization. Options for filtering, overscan and output of motion vectors are available.
set cut_paste_input [stack 0]
version 10.5 v7
push 0
push $cut_paste_input
Group {
inputs 2
name CS_StabilizeCamRotation1
tile_color 0x9c0000ff
addUserKnob {20 CS_StabilizeCamRotation}
addUserKnob {41 stabilize_frame l "stabilize frame" T FrameHold1.first_frame}
addUserKnob {41 mapping_distance l "mapping distance" T Sphere1.radius}
addUserKnob {26 Scanline_Renderer l "@b;Scanline Renderer"}
addUserKnob {41 filter T ScanlineRender1.filter}
addUserKnob {41 overscan T ScanlineRender1.overscan}
addUserKnob {26 Motion_Vectors l "@b;Motion Vectors"}
addUserKnob {41 motion_vectors_type l "motion vectors" T ScanlineRender1.motion_vectors_type}
addUserKnob {41 MB_channel l "motion vector channels" T ScanlineRender1.MB_channel}
}
Input {
inputs 0
name Inputcam
xpos 840
ypos 470
number 1
}
Dot {
name Dot2
xpos 874
ypos 570
}
set N9c326c00 [stack 0]
Dot {
name Dot3
xpos 874
ypos 714
}
set N9c327000 [stack 0]
FrameHold {
first_frame 1001
name FrameHold1
selected true
xpos 840
ypos 776
}
push $N9c327000
push $N9c326c00
Input {
inputs 0
name Input
xpos 1280
ypos 470
}
Dot {
name Dot294
xpos 1314
ypos 570
}
set N9c326000 [stack 0]
Project3D2 {
inputs 2
project_on back
crop false
name Project3D1
xpos 1060
ypos 566
}
Sphere {
radius 10000
name Sphere1
xpos 1060
ypos 638
}
TransformGeo {
inputs 2
name TransformGeo1
xpos 1060
ypos 710
}
push $N9c326000
Remove {
name Remove1
label "\[value channels]"
xpos 1280
ypos 769
}
ScanlineRender {
inputs 3
conservative_shader_sampling false
filter Keys
shutteroffset centred
motion_vectors_type off
name ScanlineRender1
xpos 1060
ypos 782
}
Output {
name Output
xpos 1060
ypos 878
}
end_group
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment