Skip to content

Instantly share code, notes, and snippets.

@monsieuroeuf
monsieuroeuf / Pause till layer marker.js
Created July 24, 2015 05:05
After Effects: stop a nested comp playing till you want it to.
try {
m = thisLayer.marker.nearestKey(time);
linear(time, m.time, outPoint, 0, outPoint - m.time);
} catch(e) {
value
}
@monsieuroeuf
monsieuroeuf / Front Finder window to Launchbar.applescript
Created July 22, 2015 00:25
Send the front Finder window to Launchbar.
tell application "Finder"
set x to (folder of (front window)) as alias
set y to get POSIX path of (x as text)
end tell
tell application "LaunchBar"
set selection to y
end tell
@monsieuroeuf
monsieuroeuf / outExpoGentler.js
Last active August 4, 2016 01:50
Quick experiment for @SamSweetmilk #easeandwizz
// Ease and Wizz 2.0.7 : outExpo : All keyframes
// Ian Haigh (http://ianhaigh.com/easeandwizz/)
// Last built: 2015-07-09T10:37:52+10:00
// some defaults
var p = 0.81; // period for elastic
var a = 50; // amplitude for elastic
var s = 1.70158; // overshoot amount for "back"
function easeandwizz_outExpo(t, b, c, d) {
var CORRECTION = 1.037204526;
@monsieuroeuf
monsieuroeuf / Create markers in active sequence.jsx
Last active August 4, 2016 01:50
Premiere Pro: Give it a list of times in seconds, and it'll bosh a whole lot of markers into the active sequence. #premiere
#target premierepro-8.0
// 2014-09-08 Ian Haigh (ianhaigh.com)
// Give it a list of times in seconds, and it'll bosh a whole lot of markers into the active sequence. Useful in combination with "List marker times in active sequence.jsx"
m = app.project.activeSequence.markers;
var times = [55.68,87.88,165.16,205.32,258.12,337.76,379.56,442.04,509,600,705.72,828.32,940.32,984.32,1023.04,1084.32,1170.08,1225.76,1313.28,1454.64,1563.32,1664.76,1951.48,2353.68];
for (var c=0; c < times.length; c++) {
@monsieuroeuf
monsieuroeuf / List marker times in active sequence.jsx
Created September 8, 2014 02:32
Premiere Pro: lists all the markers' times in seconds, for the active sequence.
#target premierepro-8.0
// 2014-09-08 Ian Haigh (ianhaigh.com)
// Simply lists all the markers' times in seconds, for the active sequence.
m = app.project.activeSequence.markers;
var first = m.getFirstMarker();
var current = first;
@monsieuroeuf
monsieuroeuf / markerbeat.rb
Last active February 21, 2024 05:44
Makes evenly spaced markers for Adobe Premiere Pro, useful for cutting to music. Give it a BPM & duration and it'll give you some marker data for pasting into an XML document.
#!/usr/bin/env ruby -wU
# markerbeat.rb by Ian Haigh 2015
# distributed under the MIT license, more info here
# http://opensource.org/licenses/MIT
require 'optparse'
class FrameMarker
attr_accessor :bpm, :duration, :framesPerSecond
@monsieuroeuf
monsieuroeuf / Count up to a number.js
Last active November 15, 2016 16:23
After Effects expression that increments a number, with Ease and Wizz easing. It takes the start value from the name of the text layer, and the end value from a marker comment on that same layer. #easeandwizz
// Count up to a specified value in a given amount of time.
// With commas! If you're into that kind of thing.
// how to set up …
// start : this layer's name (i.e. call it an integer like "0")
// duration: add an expression slider called "duration"
// total: add a marker with a comment, that's the number to count up to
// delay: edit the value below
var DELAY = 0; // time to begin counting
@monsieuroeuf
monsieuroeuf / Ease and Wizz elastic in one dimension.js
Last active October 11, 2018 13:57
How to use Ease and Wizz's elastic easing in one dimension, even when applied to a 2D property like scale. Line 60 is where the magic happens. #easeandwizz
// Ease and Wizz 2.0.4 : outElastic : All keyframes
// Ian Haigh (http://ianhaigh.com/easeandwizz/)
// Last built: 2013-07-05T11:46:51+10:00
// some defaults
var p = 0.81; // period for elastic
var a = 50; // amplitude for elastic
var s = 1.70158; // overshoot amount for "back"
function easeandwizz_outElastic(t, b, c, d, a, p) {
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (!a || a < Math.abs(c)) { a=c; var s=p/4; }
@monsieuroeuf
monsieuroeuf / vcard-to-csv.py
Last active December 25, 2015 05:59
Parse vcard file[s] generated by Contacts.app on OS X, and spit out some csv values suitable for use with Campaign Monitor etc.
#!/usr/bin/env python
import vobject
import sys
for fname in sys.argv[1:]:
f = open(fname)
v = vobject.readComponents(f)
while True:
@monsieuroeuf
monsieuroeuf / All E&W functions.js
Created July 22, 2013 05:45
All of the Ease and Wizz functions, as adapted from Robert Penner's easing equations.
function easeandwizz_inBack(t, b, c, d) {
return c*(t/=d)*t*((s+1)*t - s) + b;
}
function easeandwizz_inOutBack(t, b, c, d) {
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}
function easeandwizz_outBack(t, b, c, d) {