Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / roto_python_examples.nk
Last active May 6, 2022 19:36
some examples for setting expressions in the python api for the nuke rotopaint system
set cut_paste_input [stack 0]
push $cut_paste_input
RotoPaint {
cliptype none
curves {{{v x3f99999a}
{f 0}
{n
{layer Root
{f 2097152}
{t x44800000 x44428000}
@jedypod
jedypod / BalanceGrade.nk
Last active December 4, 2022 14:50
BalanceGrade - A Nuke tool to neutralize and balance the color of multiple input plates. Can be used with the CalibrateMacbeth or mmColorTarget toolsets to calibrate gamut as well.
set cut_paste_input [stack 0]
push $cut_paste_input
Group {
name BalanceGrade
tile_color 0x6c9de1ff
addUserKnob {20 BalanceGrade}
addUserKnob {26 ColorMatrix_label l "@b;ColorMatrix" T " "}
addUserKnob {41 matrix T ColorMatrix.matrix}
addUserKnob {22 reset_mtx l Reset T "nuke.thisNode()\['matrix'].setValue(\[1,0,0,0,1,0,0,0,1])" +STARTLINE}
addUserKnob {26 ""}
@jedypod
jedypod / CalibrateMacbeth.nk
Last active March 20, 2024 14:52
Calibrate Macbeth: a Nuke tool to calibrate an image containing a Macbeth ColorChecker chart by calculating a ColorMatrix node that conforms it to a specified colorspace gamut.
set cut_paste_input [stack 0]
version 14.0 v2
push $cut_paste_input
Group {
name CalibrateMacbeth
tile_color 0x87aee7ff
selected true
xpos 197
ypos -199
addUserKnob {20 CalibrateMacbeth}
@jedypod
jedypod / aftershot3_enable_dng_support.md
Last active October 17, 2020 15:19
Enable Adobe DNG Support in Corel AfterShot Pro 3

Enable DNG Support for Your Camera in Corel AfterShot Pro 3

AfterShot 3 does not support DNG files well, despite their claims to the contrary.

What if we need to use DNG files in our photo collection? There are valid reasons to need this, for example if you use Magic Lantern Dualiso raw files on your Canon camera and you need to use the DNG format to store the raw image after blending the exposures.

AfterShot does open DNG files if certain conditions are met. If you have specific supported cameras, AfterShot will open DNG files, but only if it has the right compression settings and metadata. The DNG file has to be uncompressed, and it must contain the Exif.Image.Model metadata matching a "known" camera.

Hack Your Own Camera Profile

  1. On the Aftershot Downloads Page there are AfterShot Pro Camera Profiles available for download.
@jedypod
jedypod / DefocusSwirlyBokeh.nk
Last active June 8, 2022 04:37
Creates Defocus with Swirly Bokeh aka Cat's Eye Bokeh. Based on Alexander Kulikov's CatsEyeDefocus: www.nukepedia.com/blink/filter/catseyedefocus.
set cut_paste_input [stack 0]
push $cut_paste_input
Group {
name DefocusSwirlyBokeh
tile_color 0xb16f43ff
addUserKnob {20 DefocusSwirlyBokeh}
addUserKnob {6 usegpu l "use gpu" t "You REALLY need a good GPU to use this node effectively. With CPU it will be excruciatingly slow." +STARTLINE}
usegpu true
addUserKnob {7 size l "bokeh size" t "The size of your defocus." R 2 100}
size 25
@jedypod
jedypod / connect_to_closest.py
Created November 6, 2019 15:04
Nuke python script to connect each selected node's 0th input to the nearest node.
"""
# Add to menu.py
import connect_to_closest
nuke.toolbar('Nuke').addCommand('Edit/Node/Connect Multiple', 'connect_to_closest.run()', 'meta+shift+y', shortcutContext=2)
"""
import nuke
import math

Compile GafferCycles with OIDN

Trying to compile the [https://github.com/boberfly/GafferCycles/tree/oidn](oidn branch of gafferCycles) to get OpenImageDenoise working in Gaffer.

# Compile with vfx reference platform docker
docker run -it --mount type=bind,source=/pod/sw/compile/gaffercycles,target=/root --mount type=bind,source=/opt,target=/root/opt --entrypoint /bin/bash gaffercycles-1

# Set up env
export GAFFER_ROOT=~/opt/gaffer/gaffer
@jedypod
jedypod / Dockerfile
Last active September 2, 2019 02:51
Compile Blender 2.8 on Centos 7.6 using Docker
FROM centos
LABEL maintainer="mattias.ohlsson@inprose.com"
ENV HOME /root
WORKDIR $HOME
RUN yum update -y && yum clean all
# Install packages