Skip to content

Instantly share code, notes, and snippets.

View kpprt's full-sized avatar

Christian Kauppert kpprt

View GitHub Profile
@kpprt
kpprt / SimpleIBMTextToSpeechWS.cs
Last active September 18, 2020 19:59
A simple MonoBehaviour for testing the TextToSpeech service of IBM Watson via Websocket connection. Tested with IBM unity-sdk 4.8.0 and IBM unity-sdk-core 1.2.1. Currently there seems to be no way to determine the final length of the AudioClip while streaming the data. So we use an _estimatedAudioLength that defines the length of our Playback Au…
using System.Collections;
using System.Collections.Generic;
using IBM.Cloud.SDK.Authentication;
using IBM.Cloud.SDK.Authentication.Iam;
using IBM.Cloud.SDK.Utilities;
using IBM.Watson.TextToSpeech.V1;
using UnityEngine;
[RequireComponent(typeof(AudioSource))]
@kpprt
kpprt / write_makedirs.py
Created October 18, 2019 18:31
Short snippet to create output folders of a Write Node in Nuke.
import os
n = nuke.selectedNode()
if n.Class() != 'Write':
nuke.message('No Write Node selected')
else:
filepath = os.path.dirname(n['file'].evaluate())
proxypath = os.path.dirname(n['proxy'].evaluate())
question = 'Yes = create normal file path:\n'
@kpprt
kpprt / CK_Write.tcl
Last active September 1, 2023 08:56
An advanced Write node for Nuke where you can define certain path fragments which are combined to the final path via expressions.
set cut_paste_input [stack 0]
version 10.5 v1
push $cut_paste_input
Write {
file "\[string trimright \[value projectroot] \\\\/]/\[string trimright \[value outputfolder] \\\\/]/\[string trimright \[value shot] \\\\/]/\[string trimright \[value task] \\\\/]/\[if \{\[value enable_cache]\} \{return \[value cachefolder]/\[string trimright \[value cache] \\\\/]/\}]\[if \{\[value file_type] == \"mov\"\} \{return \[string trimright \[value outputfilename] \\\\/].\[value file_type]\} \{return \[string trimright \[value outputfilename] \\\\/]/\[string trimright \[value outputfilename] \\\\/]\[value padding].\[value file_type]\}]"
proxy "\[string trimright \[value projectroot] \\\\/]/\[string trimright \[value outputfolder] \\\\/]/\[string trimright \[value shot] \\\\/]/\[string trimright \[value task] \\\\/]/\[if \{\[value enable_cache]\} \{return \[value cachefolder]/\[string trimright \[value cache] \\\\/]/\}]\[if \{\[value file_type] == \"mov\"\} \{return \[string trimright \[value outputfilename] \\\\/]\[value pro
@kpprt
kpprt / CK_AxisBlend.tcl
Last active October 4, 2019 14:07
Blend between two Axis' in Nuke. Caution: The resulting Axis might be skewed while blending even when the sources are not! If there are time offsets on the input Axis' they need to be filled in manually since they are not taken into account automatically.
set cut_paste_input [stack 0]
version 10.5 v1
push $cut_paste_input
Group {
name CK_AxisBlend1
tile_color 0x9c0000ff
addUserKnob {20 CK_AxisBlend}
addUserKnob {3 time_offset0 l "time offset 0"}
addUserKnob {6 hold0 l hold -STARTLINE}
addUserKnob {26 space l "" -STARTLINE T " | "}
@kpprt
kpprt / createExrCamVray.py
Created February 26, 2019 16:20
Generate a camera in Nuke from the metadata of an EXR sequence that is rendered with VRay in Maya.
# code copied and adapted from https://pastebin.com/4vmAmARU
# Big thanks to Ivan Busquets who helped me put this together!
# (ok, ok, he really helped me a lot)
# Also thanks to Nathan Dunsworth for giving me solid ideas and some code to get me started.
import math
def createExrCamVray( node ):
@kpprt
kpprt / CS_CheckerBoard.tcl
Last active February 26, 2019 09:17
A simple checkerboard generator for Nuke that doesn't require a specific format. Instead it takes the input format and overwrites the rgba channels with the checkerboard colors.
set cut_paste_input [stack 0]
version 10.5 v7
push $cut_paste_input
Group {
name CS_CheckerBoard1
addUserKnob {20 CS_CheckerBoard}
addUserKnob {41 checker_size T Expression1.checker_size}
addUserKnob {41 centered T Expression1.centered}
addUserKnob {41 center l "" -STARTLINE T Expression1.center}
addUserKnob {41 colorA T Expression1.colorA}
@kpprt
kpprt / CS_SequenceViewer.tcl
Last active November 5, 2018 17:29
Shows the current shot side by side with the previous and the next shot in Nuke. Also the previous shot and the next shot are temporally aligned to the current shot.
set cut_paste_input [stack 0]
version 10.5 v7
push 0
push 0
push $cut_paste_input
Group {
inputs 3
name CS_SequenceViewer1
addUserKnob {20 CS_SequenceViewer}
}
@kpprt
kpprt / CS_StabilizeCamRotation.tcl
Last active November 1, 2018 17:07
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}
@kpprt
kpprt / CS_Line.tcl
Last active October 8, 2018 15:27
Create a straight line in Nuke from one position to another and define a width as well as rounded or square caps. Since it is realized internally with a Roto node it is also possible to render the line with Motion Blur.
set cut_paste_input [stack 0]
version 10.5 v7
push $cut_paste_input
Group {
name CS_Line1
addUserKnob {20 CS_Line}
addUserKnob {41 output T Roto1.output}
addUserKnob {41 cliptype l "clip to" T Roto1.cliptype}
addUserKnob {26 divider_shape l "@b;Shape"}
addUserKnob {41 color T Roto1.color}
@kpprt
kpprt / CS_Flicker.tcl
Created April 20, 2018 15:33
Simple Multiply node for Nuke extended with parameters to control a flicker noise.
set cut_paste_input [stack 0]
version 10.5 v3
push $cut_paste_input
Multiply {
channels rgb
value {{"offset + (noise(frame * frequency1, seed) + noise(frame * frequency2, seed)) * 0.5 * amplitude"}}
name CS_Flicker1
addUserKnob {20 Flicker}
addUserKnob {7 frequency1}
frequency1 0.123