Skip to content

Instantly share code, notes, and snippets.

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"clipname": {
"description": "The unique identifier for a product",
"type": "string"
},
@monsieuroeuf
monsieuroeuf / repositionText.lua
Created March 24, 2023 01:18
Change the position of a Text+ node in Fusion depending on the comp's aspect ratio
:local w = tonumber( comp:GetPrefs("Comp.FrameFormat.Width"))
local h = tonumber(comp:GetPrefs("Comp.FrameFormat.Height"))
-- add the colon at the start of first line to allow multiline expression
if (w / h) > 1 then return Point(0.0, 0.0)
elseif (w / h) < 1 then return Point(0.5, 0.5)
else return Point(1, 1)
end
@monsieuroeuf
monsieuroeuf / finderselection.js
Last active November 4, 2022 01:42
Quick little JXA (Javascript for Automation) for MacOS, just get the Finder selection and change it into paths. Suitable for a CLI workflow.
#!/usr/bin/osascript
// 2022-11-04
// returns target of front window if no actual selection
// prints the active Finder selection as POSIX paths,
// separated by newlines, ready to be eaten up by some other process
// I use in Fish shell like:
// for f in (finderselection.js) … etc
@monsieuroeuf
monsieuroeuf / Make Resolve play eep.py
Last active March 29, 2021 05:17
Make DaVinci Resolve play a sound when it's finished rendering
# demo code for youtube tutorial (https://youtu.be/9SrJ3mznVlY)
# note: tweaked for Python2 compatibility
# only works on a mac
# should be saved here:
# /Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/Deliver
import os
# edit this variable so that it points to the sound you'd like to play
PATH_TO_SOUND = "~/macossounds/AIFF/Wild Eep.aiff"
csvjson IAN\'S\ Scavenger\ hunt\ data\ merge\ -\ August\ 10\ update.csv > data.json
echo -n "Converting to json - "
node index.js > br.json
echo -n "Delete data.json"
echo -n "Converting to CSV - "
json2csv -i br.json > yay.csv
@monsieuroeuf
monsieuroeuf / python-api.md
Last active November 16, 2023 07:11
DaVinci Resolve API
#!/usr/local/bin/zsh
# choice script by IAN
function prores() {
select choice in proxy LT regular HQ; do
case $choice in
proxy)
echo Setting profile to proxy
profile=0

quiver:///notes/85DE3C89-A451-4736-B3B4-82EB872067DE

make a bunch of MP4s out of pngs and mp3s

typeset -Z2 c=0; for f in png/*png; do ((c++)) ffmpeg -y -loop 1 -f image2 -r 25 -i $f -i audio/${f:t:r}.mp3 -c:v libx264 -c:a copy -shortest $c.mp4 done


@monsieuroeuf
monsieuroeuf / auto-fade-in.js
Created June 20, 2017 07:29
Auto fade text expression for After Effects
// auto fade text, IN
// http://ianhaigh.com/
try {
var fadeDuration = effect("fade duration")("Slider");
} catch(e) {
var fadeDuration = 1;
}
ease(time, inPoint, inPoint + fadeDuration, 100, -100);
@monsieuroeuf
monsieuroeuf / auto expoIn and expoOut.js
Created March 16, 2016 03:12
After Effects expression: automatic motion with expo easing
// Ian Haigh : http://ianhaigh.com/
// automatic motion for After Effects with expo easing
// set up sliders to easily change the values
function easeandwizz_inExpo(t, b, c, d) {
var IN_EXPO_CORRECTION = 0.000976;
return t==0 ? b : c * (Math.pow(2, 10 * (t/d - 1)) - IN_EXPO_CORRECTION) + b;
}
function easeandwizz_outExpo(t, b, c, d) {