Skip to content

Instantly share code, notes, and snippets.

@monsieuroeuf
monsieuroeuf / DaVinci Resolve Scripting Doc.txt
Created November 13, 2024 02:53 — forked from X-Raym/DaVinci Resolve Scripting Doc.txt
DaVinci Resolve Scripting API Doc v19.1
Last Updated: 28 October 2024
-----------------------------
In this package, you will find a brief introduction to the Scripting API for DaVinci Resolve Studio. Apart from this README.txt file, this package contains folders containing the basic import
modules for scripting access (DaVinciResolve.py) and some representative examples.
From v16.2.0 onwards, the nodeIndex parameters accepted by SetLUT() and SetCDL() are 1-based instead of 0-based, i.e. 1 <= nodeIndex <= total number of nodes.
Overview
--------
As with Blackmagic Fusion scripts, user scripts written in Lua and Python programming languages are supported. By default, scripts can be invoked from the Console window in the Fusion page,
{
"$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);