Skip to content

Instantly share code, notes, and snippets.

View baku89's full-sized avatar
🍡

Baku 麦 baku89

🍡
View GitHub Profile
@baku89
baku89 / opacity.js
Last active August 29, 2015 13:56
プレゼン映像のタイトルや吹き出し・矢印など、繰り返し使うようなアニメーションを "_SETTINGS"というコンポジションの中にまとめて宣言して、 レイヤーのインポイントから自動的にアニメーションが開始されるように設定
// opacity
type = "opacity_fade_in";
try {
v = comp("_SETTINGS").layer(type).transform.opacity.valueAtTime(time - thisLayer.inPoint);
} catch(err) {
v = value
}
v
@baku89
baku89 / anime-remap.js
Created March 4, 2014 03:33
アニメの簡単なリマップ編集用です。タイムリマップにペーストして使います。レイヤーマーカーを用いて指定フレーム間の再生やループができます。
var params = {
'in': [0, 44, false],
'loop': [45, 134, true],
'out': [135, 195, false]
};
// ------------
if (marker.numKeys) {
var pm = marker.nearestKey(time);
if (pm.index == 1 && time < pm.time) {
@baku89
baku89 / GLSL-segmentDistance
Created December 17, 2014 07:48
点と線分の距離を算出. 直線の描画に使える
float lineSegDistance( vec2 p, vec2 l1, vec2 l2) {
float a2 = pow( distance(l1, p), 2.0 );
float b2 = pow( distance(l2, p), 2.0 );
float c = abs( distance(l1, l2) );
float c2 = c * c;
if ( a2 + c2 < b2 || b2 + c2 < a2 ) {
return 10000000000000000000.0;
}
@baku89
baku89 / post.coffee
Created April 20, 2015 05:20
Capturing canvas as png sequence
# canvas will be exported to "./export/test/test000089.png"
canvas = document.cleateElement('canvas')
# draw something on canvas..
# post
$.ajax
type: "POST"
url: './save.php'
@baku89
baku89 / keyframe-software.md
Last active August 29, 2015 14:21
キーフレームを打つための汎用ツールがほしい

キーフレームを打つための汎用ツールがほしい

インタラクティブとかフィジカル・コンピューティング周りで、キーフレームアニメーション作りたいなーってケースが最近増えてきた。

ジェネ系の作品って、ダタのガンマカーブやcubic-bezierのアニメーションが多かったりして、全然モーションに気を配ってないなって思うこと多い。だから、AEとかC4Dみたいな感覚でアニメーションの試行錯誤ができるようになったらもっとジェネ表現は気持ちよくなる気がする。

例えばoFだと、ofxTimelineがあったりするけど、もっと汎用性の高い、キーフレームアニメーションを打つ専用のスタンドアローンアプリがほしい。

  • 対数グラフが使える (一定速度でのスケール等に使える)
@baku89
baku89 / gulpfile.coffee
Created July 5, 2015 11:18
my gulpfile.coffee [07.05.15]
module.exports = gulp
#----------------------------------------
gulp = require 'gulp'
coffee = require 'gulp-coffee'
compass = require 'gulp-compass'
jade = require 'gulp-jade'
plumber = require 'gulp-plumber'
srcmap = require 'gulp-sourcemaps'
@baku89
baku89 / bk_AnimateToCurrentPos.jsx
Created August 24, 2015 07:05
AEScript: Copy position keyframes to stop with each layer's position at the end
/*
* Usage:
* 1) Select destination layers and then select source layer
* 2) Run
*/
// https://github.com/douglascrockford/JSON-js/blob/master/json2.js
#include "json2.js"
main();
@baku89
baku89 / example.sh
Last active September 8, 2015 13:12
proce55ing with pipeline
./p5-pipe.sh pipe_invert pipe_blur --args ./sample.png
javascript:charas=["asuka","natsuki","kaori","hazuki","sapphire","haruka","yuuko","shuichi","reina"];$.each(charas,function(a,u){$("."+u).css("background-image","url(http://baku89.com/files/kumiko/kumiko_"+a+".jpg")});
@baku89
baku89 / fader.js
Created December 27, 2013 14:14
一定時間かけて直前のキーフレームの値にアニメーションします。F.I F.Oを繰り返す時などに使えます。 duration: アニメーションの長さ
var duration = 1;
if (thisProperty.numKeys < 2) {
value
} else {
var pk = nearestKey(time);
(pk.index > 1 && time < pk.time) ? pk = thisProperty.key(pk.index-1) : false;
if (time - pk.time < duration && pk.index > 1) {
ease(time, pk.time, pk.time+duration, thisProperty.key(pk.index-1).value, pk.value);
} else {