Aftereeffects のエクスプレッションのseedRandom固定させる Script
エクスプレッションで
Random
Wiggle
などランダムな数を使用するとき
レイヤーの順番変えたら動き変わって困るときは
seedRandom()をつかってseed固定します。
まぁ、エクスプレッションの先頭に1行入れるだけですが
今回挿入するプロパティが多かったので自動化Script作りました。
使い方は
プロパティ選択して、Script実行するだけ。
自動でエクスプレッションの先頭に、1文が挿入されます。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//エクスプレッションにseedRandomを挿入するスクリプト | |
//使い方は:レイヤーのプロパティ選択して実行するだけ | |
props = app.project.activeItem.selectedProperties; | |
for (var i = 0; i < props.length; i++){ | |
if (props[i].canSetExpression){ | |
//レイヤーインデックスを取得してエクスプレッション用に演算 | |
selLayIn4Exp = app.project.activeItem.selectedLayers[0].index -1; | |
//既存のエクスプレッションの内容の先頭に追加 | |
expression = props[i].expression | |
props[i].expression = "seedRandom("+selLayIn4Exp+");\n"+expression; | |
} | |
} |
参考サイト!!
https://www.cg-method.com/entry/expression-to-script/
http://aejsx.hiroshisaito.net/layer-object/attributes/index
0 コメント:
コメントを投稿