Skip to content

Instantly share code, notes, and snippets.

@jedypod
jedypod / pworld_to_stmap_example.nk
Created February 16, 2020 20:38
PWorld to STMap Example
set cut_paste_input [stack 0]
version 12.0 v4
Camera2 {
inputs 0
translate {{curve x1 0.1968241632 s0 x20 1.389938712 s0} {curve x1 0.6442195177 s0 x20 0.4735943973 s0} {curve x1 5.948436737 s0 x20 7.470496655 s0}}
rotate {{curve x1 2.000000954 s0 x20 0.8000015616 s0} {curve x1 7.399996758 s0 x20 6.199992657 s0} {curve x1 2.669668575e-08 s0 x20 -1.334151278e-08 s0}}
name Camera1
selected true
xpos -140
ypos -918
@jedypod
jedypod / README.md
Created February 21, 2020 17:00
Nuke Python script to retime selected Roto, RotoPaint. or SplineWarp nodes.

Retime Roto

This is a python script for Nuke to retime roto shapes. It supports shapes only, not strokes, not opensplines.

It works by looping through each roto node, each shape in the roto node, and each point on the shape. It creates an expression on each point referencing a frame_lookup knob. Put a retime curve on this knob and your shapes will be retimed.

@jedypod
jedypod / GamutCompression_blinkscript.cpp
Last active August 29, 2024 13:48
Jed Smith Gamut Compression Development
kernel GamutCompression : ImageComputationKernel<ePixelWise> {
Image<eRead, eAccessPoint, eEdgeClamped> src;
Image<eWrite> dst;
param:
float threshold;
float cyan;
float magenta;
float yellow;
int method;
@jedypod
jedypod / custom_ui_docked.py
Created April 22, 2020 18:55 — forked from fredrikaverpil/custom_ui_docked.py
Create custom PySide GUI and dock it into Nuke UI
import PySide.QtCore as QtCore
import PySide.QtGui as QtGui
from nukescripts import panels
class PanelTest(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setLayout(QtGui.QVBoxLayout())
self.myTable = QtGui.QTableWidget()
self.myTable.header = ['Date', 'Files', 'Size', 'Path' ]
@jedypod
jedypod / nuke_viewer_shortcut_intercept.py
Created May 11, 2020 03:26 — forked from dbr/nuke_viewer_shortcut_intercept.py
Test of finding Nuke's viewer widget, and intercepting the hardwired "c" shortcut and rewiring it to view the RGB channel
"""Test of finding Nuke's viewer widget, and intercepting the hardwired "c" shortcut and rewiring it to view the RGB channel
"""
from PySide import QtGui, QtCore
def findviewer():
stack = QtGui.QApplication.topLevelWidgets()
viewers = []
while stack:
@jedypod
jedypod / menu.py
Created May 11, 2020 03:32 — forked from dbr/menu.py
Alternative viewer connection shorcuts - alt+1..9 connect viewer, 1..9 only switch viewer
def viewer_shotcuts_alt():
# Alt+1, Alt+2 etc to connect node to viewer
for n in range(9):
def connect_viewer(n=n):
selection = nuke.selectedNodes()
nuke.connectViewer(n, nuke.selectedNode())
[node.setSelected(False) for node in nuke.selectedNodes()]
[node.setSelected(True) for node in selection]
nuke.menu("Node Graph").addMenu("ViewerThing").addCommand(
@jedypod
jedypod / opusencdir
Created August 2, 2020 21:17
opusencdir is a Python tool to recursively encode contents of source directory into Opus audio files.
#!/usr/bin/python3
import os, sys, re, shutil
import logging
import threading
import concurrent.futures
import multiprocessing
import argparse, shlex
@jedypod
jedypod / Transform.cpp
Last active August 24, 2025 07:16
Nuke blinkscript implementation of a simple image Transform operator. This blinkscript demonstrates pixel filter interpolation algorithms.
/*
Nuke blinkscript implementation of a simple image Transform operator.
Demonstrates pixel filter interpolation algorithms.
The following pixel filters are implemented:
0 - Blackman-Harris : Similar to cubic, but better performance in high frequencies
1 - Lanczos4 : 2x2 lanczos windowed sinc function
2 - Lanczos6 : 3x3 lanczos windowed sinc function
3 - Cubic : (Bicubic interpolation) - a=0.0, b=0.0
4 - Mitchell : (Bicubic interpolation) - a=1/3, b=1/3
@jedypod
jedypod / Distort.cpp
Created October 19, 2020 19:59
Distorts an input image based on an input uv map or vector map.
kernel Distort : ImageComputationKernel<ePixelWise> {
Image<eRead, eAccessRandom, eEdgeClamped> in;
Image<eRead, eAccessPoint, eEdgeClamped> uv;
Image<eWrite, eAccessPoint> out;
param:
bool stmap;
bool enable_blur;
float blur_size;
int blur_samples;
@jedypod
jedypod / BoxBlur.cpp
Created October 19, 2020 20:04
Perform a multiple iteration box blur on the input image. Works in a single dimension so 2 copies are needed for a 2 dimensional blur.
/* Perform a horizontal or vertical Box Blur
Can perform multiple iterations in order to approximate a Gaussian Blur.
*/
kernel BoxBlur : ImageComputationKernel<eComponentWise> {
Image<eRead, eAccessRandom, eEdgeClamped> src;
Image<eReadWrite, eAccessRandom, eEdgeClamped> dst;
param:
float2 size; // blur size
int iterations; // number of iterations to perform