Skip to content

Instantly share code, notes, and snippets.

View kpprt's full-sized avatar

Christian Kauppert kpprt

View GitHub Profile
@kpprt
kpprt / CS_WiggleAxis.tcl
Last active August 29, 2015 14:24
WiggleAxis to create a 3D shake for Nuke
set cut_paste_input [stack 0]
version 9.0 v5
push $cut_paste_input
Axis2 {
translate {{"noise(frame * frequency, seeds.x) * noise(frame * frequency * 0.666, seeds.y) * noise(frame * frequency * 0.333, seeds.z) * amplitude * 8"} {"noise(frame * frequency, seeds.z) * noise(frame * frequency * 0.666, seeds.x) * noise(frame * frequency * 0.333, seeds.y) * amplitude * 8"} {"noise(frame * frequency, seeds.y) * noise(frame * frequency * 0.666, seeds.z) * noise(frame * frequency * 0.333, seeds.x) * amplitude * 8"}}
name CS_WiggleAxis1
selected true
xpos 0
ypos 0
addUserKnob {20 Wiggle}
@kpprt
kpprt / CS_Looper.tcl
Last active April 27, 2018 09:28
Simple Looper with cross dissolve functionality for Nuke
set cut_paste_input [stack 0]
version 10.5 v3
push $cut_paste_input
Group {
name CS_Looper1
tile_color 0xafa35dff
selected true
xpos 7880
ypos 5798
addUserKnob {20 Looper}
@kpprt
kpprt / CS_PixelOffsetExpression.tcl
Created July 15, 2015 11:35
Expression for Nuke to easily offset and repeat pixels at the edge of the image
set cut_paste_input [stack 0]
version 9.0 v5
push $cut_paste_input
Expression {
temp_name0 dx
temp_expr0 "(x - offset.x + width) % width"
temp_name1 dy
temp_expr1 "(y - offset.y + height) % height"
expr0 "r(dx, dy)"
expr1 "g(dx, dy)"
@kpprt
kpprt / CS_SoftTiler.tcl
Last active August 29, 2015 14:25
Tiling Helper for Nuke that blends between offsetted repeated pixels
set cut_paste_input [stack 0]
version 9.0 v5
push $cut_paste_input
Group {
name CS_SoftTiler1
selected true
xpos 0
ypos 0
addUserKnob {20 SoftTiler}
addUserKnob {12 offset}
@kpprt
kpprt / CS_SnappyBackdrops.py
Last active August 29, 2015 14:26
Automatically resize and snap backdrops to the grid in Nuke
import nuke
prefs = nuke.toNode('preferences')
grid_width = prefs['GridWidth'].getValue()
grid_height = prefs['GridHeight'].getValue()
def resize_to_grid():
n = nuke.thisNode();
k = nuke.thisKnob();
if knob_to_grid(k, 'bdwidth', grid_width) or knob_to_grid(k, 'bdheight', grid_height):
@kpprt
kpprt / CS_JelloEffect.tcl
Created September 16, 2015 14:49
Create a simple Jello Effect in Nuke. It is basically just a lens distortion node with auto scaling functionality.
set cut_paste_input [stack 0]
version 9.0 v5
push $cut_paste_input
Group {
name CS_JelloEffect1
selected true
xpos -2900
ypos 1166
addUserKnob {20 CS_JelloEffect}
addUserKnob {7 effect R -1 1}
@kpprt
kpprt / CS_FixFrames.tcl
Last active July 1, 2016 14:56
Interpolate between frames to restore broken frames in Nuke.
set cut_paste_input [stack 0]
version 9.0 v8
push $cut_paste_input
Group {
name CS_FixFrames1
addUserKnob {20 CS_FixFrames}
addUserKnob {3 first_frame_to_fix l range}
first_frame_to_fix 1
addUserKnob {3 last_frame_to_fix l "" -STARTLINE R 0 100}
last_frame_to_fix 1
@kpprt
kpprt / CS_PositionToDepth.tcl
Last active March 20, 2018 14:39
Converts a world position pass (Input 1, Channels RGB) to a camera (Input 2) relative Nuke depth pass. CAUTION: Does not work with retimed camera input!
set cut_paste_input [stack 0]
version 10.5 v3
push $cut_paste_input
Group {
name CS_PositionToDepth
}
Input {
inputs 0
name InputWPP
xpos -920
@kpprt
kpprt / CS_AutoBBox.tcl
Last active September 2, 2017 09:50
Autocrop node for Nuke. Basically just a CurveTool setup with some links and presets for autocropping.
set cut_paste_input [stack 0]
version 10.5 v3
push $cut_paste_input
Group {
name CS_AutoBBox1
selected true
xpos -8180
ypos -3184
addUserKnob {20 CS_AutoBBox}
addUserKnob {41 color T CurveTool1.color}
@kpprt
kpprt / get_maximum_frame_range.py
Last active January 14, 2016 14:03
Get the maximum frame range of all write nodes in Nuke
import nuke
in_min = sys.maxint
out_max = -sys.maxint
for n in nuke.allNodes():
if n.Class() == 'Write':
n_in = int(n.knob('first').getValue())
n_out = int(n.knob('last').getValue())
if(n_in < in_min):
in_min = n_in