今回はsampleImageについて少し解説しました。

thisComp.layer("作業1_1").sampleImage([p[0], p[1]], [rd[0], rd[1]], postEffect = false)

thisComp.layer(“作業1_1”)でレイヤーを指定します。

[p[0], p[1]]で指定したレイヤーのポイントを指定します。例えば

[360, 180]

と書くと指定したレイヤーのx360、y180の座標を指定できます。

[rd[0], rd[1]]で指定したポイントからのx,yの範囲を決めます。

[5, 15]

と書くと指定したポイントからxに-5~5、yに-15~15の四角形の範囲で色を取得し平均化します。

postEffect = falseでエフェクトとマスクのレンダリング前の結果を取得します。
trueにするとレンダリング後の結果を取得します。

thisComp.layer("作業1_1").sampleImage([360, 180], [50, 150], postEffect = false)

と書くと、作業レイヤー1_1のx360,y180のポイントからx-50~50,y-150~150の範囲の色の平均値を出力します。
黒の四角がそれに当たります。

sampleImageはRGBαの4つの配列で構成されています。
ですのでその一つだけを取り出したい時には

thisComp.layer("作業1_1").sampleImage([360, 180], [50, 150], postEffect = false)[0]

と、最後に配列を指定してあげます。

[0]がR、[1]がG、[2]がB、[3]がαとなっています。
出力される値は0~1となっています。
不透明度等に使うときは×100等してください。

コピペ用エクスプレッション

4:57
開始ポイント

x1 = thisComp.width / 2;
x2 = effect("x")("スライダー");
y = effect("y")("スライダー");
x = x1 - x2;
[x, y]

終了ポイント

x1 = thisComp.width / 2;
x2 = effect("x")("スライダー");
y = effect("y")("スライダー");
x = x1 + x2;
[x, y]

7:27
PositionX

x = comp("comp1").layer("ブラック 平面 1").effect("オーディオスペクトラム")("終了ポイント")[0] - comp("comp1").layer("ブラック 平面 1").effect("オーディオスペクトラム")("開始ポイント")[0];
x / (comp("comp1").layer("ブラック 平面 1").effect("オーディオスペクトラム")("周波数バンド") - 1)

8:43
Radius

effect("PositionY")("スライダー") / 2

8:58
Square_1
位置

ni1 = name.indexOf("_", 0);
ns = name.slice(ni1 + 1, name.length);
x1 = thisComp.layer("null").effect("PositionX")("スライダー");
y1 = thisComp.layer("null").effect("PositionY")("スライダー");
re1 = thisComp.layer("null").effect("Return")("スライダー");
re = Math.ceil(ns / re1);
x = (re - 1) * x1;
y = (ns - 1 - re1 * (re - 1)) * - y1;
p = comp("comp1").layer("ブラック 平面 1").effect("オーディオスペクトラム")("開始ポイント");
[p[0] + x, p[1] + y, 0]

9:12
スケール

temp = thisComp.layer("null").effect("Scale")("スライダー");
[temp, temp, temp]

9:27
不透明度

p = transform.position;
rd = thisComp.layer("null").effect("Radius")("スライダー");
si = Math.ceil(thisComp.layer("comp1").sampleImage([p[0], p[1]], [1, rd], postEffect = false)[0]);
if(si >= 1){100} else {0}

利用規約
https://effects-world.com/?page_id=1180

チャンネル登録、いいね!SNSでの拡散などお願いします!
http://www.youtube.com/channel/UCp0Du2uqAAHzv-OIKa-8zvw?sub_confirmation=1

aep
066_sampleImage

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です


四 − 1 =

CAPTCHA