Skip to content

Instantly share code, notes, and snippets.

View kpprt's full-sized avatar

Christian Kauppert kpprt

View GitHub Profile
@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 / 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 / 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))]