AEスクリプト用のライブラリ。
type: Startup (Startupフォルダに配置してお使いください。)
version: 0.2.0 (2014/12/06)
プロパティがPropertyオブジェクトかどうかを調べます。
@param {PropertyBase} property - 調べたいプロパティ。
プロパティがPropertyGroupオブジェクトかどうかを調べます。
@param {PropertyBase} property - 調べたいプロパティ。
初めに選択されたレイヤーではじめに選択されたプロパティを返します。なければnullを返します。
@param {bool} [with_layer=false] - レイヤーの情報も返すかどうか。
@return {(Property|object|null)} - 存在しなければnull、存在すればwith_layerがfalseならPropertyを、trueならば{layer: Layer, property: Property}のオブジェクトを返す。
プロパティがPropertyGroupオブジェクトかどうかを調べます。
@param {bool} [with_layer=false] - レイヤーの情報も返すかどうか。
@param {object} options - {
multiple: bool(default: true) - falseなら最初に選択したレイヤーのみ、trueならば選択レイヤー全てを対象とする。
propertyGroup: bool(default: false) - trueならばプロパティグループも含む。
filter: function - プロパティを引数にとりブール値を返す関数を与える。
}
@return {array} - with_layerがfalseならPropertyBaseの配列、trueならば{layer: Layer, properties: array}の配列を返す。
プロパティの値を設定します。
@param {Property} property - 対象のプロパティ。
@param {number} time - 時間。
@param value - プロパティの種類に応じた値。
@param {bool} [keyframe=false] - キーフレームを必ず打つか。
文字列をパスに変換。(参照: Path)
@param {string} path
プロパティオブジェクトのパスを取得。
@param {PropertyBase} property
@param {string} [type=name] - name: 名前で取得する。, matchname: マッチネームで取得する。
@return {array}
選択中のプロパティのパスを取得。
@param {string} [type=name] - name: 名前で取得する。, matchname: マッチネームで取得する。
@return {array}
レイヤーのプロパティをパスを用いて取得。(参照: Path)
@param {Layer} layer
@param {(string|array)} path - パスを文字列か、配列で与える。
@return {PropertyBase}
アクティブなコンポジションを取得。なければnullを返す。
@return {(CompItem|null)}
フィルタを設定し、フィルタを通ったコンポジションのみを配列で取得する。なければnullを返す。(参照: Filters For Comp)
@param {array} filters - フィルタ群を配列で指定する。例: ['selected', ['comment', 'important']] (選択されていて、かつコメントにimportantを含む)
@return {(array|null)}
フィルタを設定し、フィルタを通ったコンポジションのみを選択する。(参照: Filters For Comp)
@param {array} filters - フィルタ群を配列で指定する。
@return {KIKAKU.Utils}
コンポジション群に対して、属性の付加等を行う。(参照: Attributes For Comp)
@param {array} comps - CompItemの配列。
@param {array} attributes - 付加する属性等の配列
@return {KIKAKU.Utils}
選択されているコンポジションに対して、属性の付加等を行う。(参照: Attributes For Comp)
@param {array} attributes - 付加する属性等の配列
@return {KIKAKU.Utils}
nameを名前に含むコンポジションを取得する。
@param {string} name - 取得したいコンポジションの名前。
@return {(null|CompItem)} - 存在すればCompItem、なければnull。
nameを名前に含むアイテム(コンポジションを含む、フォルダは除く)を取得する。
@param {string} name - 取得したいアイテムの名前。
@return {(null|AVItem)} - 存在すればAVItem、なければnull。
レイヤーがAVレイヤーかどうかを調べます。
@param {Layer} layer - 調べたいレイヤー。
@param {bool} strict(default: false) - 映像ソースがないレイヤーを除くかどうか。trueだと除く。
レイヤーがテキストレイヤーかどうかを調べます。
@param {Layer} layer - 調べたいレイヤー。
レイヤーがシェイプレイヤーかどうかを調べます。
@param {Layer} layer - 調べたいレイヤー。
レイヤーがカメラレイヤーかどうかを調べます。
@param {Layer} layer - 調べたいレイヤー。
レイヤーがライトレイヤーかどうかを調べます。
@param {Layer} layer - 調べたいレイヤー。
レイヤーがヌルレイヤーかどうかを調べます。
@param {Layer} layer - 調べたいレイヤー。
選択しているレイヤー群のうちはじめのレイヤーを取得する。なければnullを返す。
@return {(Layer|null)}
選択しているレイヤー群の配列を取得する。
@return {array}
フィルタを設定し、フィルタを通ったレイヤーのみを配列で取得する。なければnullを返す。(参照: Filters For Layer)
@param {array} filters - フィルタ群を配列で指定する。例: ['selected', ['comment', 'important']] (選択されていて、かつコメントにimportantを含む)
@return {(array|null)}
フィルタを設定し、フィルタを通ったレイヤーのみを選択する。(参照: Filters For Layer)
@param {array} filters - フィルタ群を配列で指定する。
@return {KIKAKU.Utils}
レイヤー群に対して、属性の付加等を行う。(参照: Attributes For Layer)
@param {array} layers - Layerの配列。
@param {array} attributes - 付加する属性等の配列
@return {KIKAKU.Utils}
選択されているレイヤーに対して、属性の付加等を行う。(参照: Attributes For Layer)
@param {array} attributes - 付加する属性等の配列
@return {KIKAKU.Utils}
レイヤー群のあるパラメータに関して代表値を取得する。(参照: Path, Representative Value)
@param {string} type - 代表値の指定。
@param {array} layers - Layerの配列。
@param {(string|array)} path - パスを文字列か、配列で与える。
@return {(number|array)} - プロパティの種類に準じた値。
選択されているレイヤーのあるパラメータに関して代表値を取得する。(参照: Path, Representative Value)
@param {string} type - 代表値の指定。
@param {(string|array)} path - パスを文字列か、配列で与える。
@return {(number|array)} - プロパティの種類に準じた値。
RGB空間からHSL空間へ変換する。
@param {array} rgba - rgbaの配列。
@return {array} - hslaの配列。各チャンネルとも0-1。
HSL空間からRGB空間へ変換する。
@param {array} hsla - hslaの配列。
@return {array} - rgbaの配列。各チャンネルとも0-1。
RGB空間からYUV空間へ変換する。
@param {array} rgba - rgbaの配列。
@return {array} - yuvaの配列。各チャンネルとも0-1。
YUV空間からRGB空間へ変換する。
@param {array} yuva - yuvaの配列。
@return {array} - rgbaの配列。各チャンネルとも0-1。
コンポジションに対するフィルタ群。(参照: string(op))
typeの頭に!を付けると反転できる。
例: frameblending(フレームブレンドがオンのを通す。) -> !frameblending(フレームブレンドがオフのを通す。)
valueをとるフィルタは配列で指定する。
例: ['width', '<=1920'] (幅が1920以下)
| type | value | 説明 |
|---|---|---|
| name | string | コンポジションの名前にvalueを含む。 |
| nameindex | string(op) | コンポジションの名前に含まれた自然数の比較。"Comp 32"の場合、32。数字が含まれてない場合は1。 |
| comment | string | コメントにvalueを含む。 |
| selected | - | 選択されている。 |
| width | string(op) | 幅の比較。 |
| height | string(op) | 高さの比較。 |
| pixelaspect | string(op) | ピクセル比の比較。 |
| framerate | string(op) | フレームレートの比較。 |
| frameduration | string(op) | フレームデュレーションの比較。 |
| duration | string(op) | デュレーションの比較。 |
| useproxy | - | プロキシを使用している。 |
| time | string(op) | 現在の時間の比較。 |
| dropframe | - | ドロップフレームがオンか。 |
| workareastart | string(op) | ワークエリアの開始時間の比較。 |
| workareaduration | string(op) | ワークエリアのデュレーションの比較。 |
| numlayers | string(op) | レイヤー数の比較。 |
| hideshylayers | - | シャイレイヤーを隠している。 |
| motionblur | - | モーションブラーがオン。 |
| draft3d | - | ドラフト3Dがオン。 |
| frameblending | - | フレームブレンドがオン。 |
| preservenestedframerate | - | ネスト化されたコンポジションのフレームレートを保持している。 |
| preservenestedresolution | - | ネスト化されたコンポジションの解像度を保持している。 |
| shutterangle | string(op) | シャッターアングルの比較。 |
| shutterphase | string(op) | シャッターフェーズの比較。 |
| motionblursamplesperframe | string(op) | モーションブラーのサンプル数の比較。 |
| motionbluradaptivesamplelimit | string(op) | モーションブラーの最大サンプル数の比較。 |
コンポジションに対する属性付加等のコマンド群。
typeの頭に!を付けるとvalueをとらないものは反転することが出来る。
例: motionblur(モーションブラーをオンにする) -> !motionblur(モーションブラーをオフにする)
| type | value1 | value2 | 説明 |
|---|---|---|---|
| remove | - | - | リムーブする。 |
| name | string | string | コンポジションの名前の前にvalue1を後ろにvalue2を加える。 |
| comment | string | - | コメントをvalue1にする。 |
| width | number | - | 幅をvalue1にする。 |
| height | number | - | 高さをvalue1にする。 |
| pixelaspect | number | - | ピクセル比をvalue1にする。 |
| framerate | number | - | フレームレートをvalue1にする。 |
| frameduration | number | - | フレームデュレーションをvalue1にする。 |
| duration | number | - | デュレーションをvalue1にする。 |
| useproxy | - | - | プロキシを使用する。 |
| time | number | - | 現在時間をvalue1にする。 |
| dropframe | - | - | ドロップフレームをオンにする。 |
| workareastart | number | - | ワークエリアの開始時間をvalue1にする。 |
| workareaduration | number | - | ワークエリアの長さをvalue1にする。 |
| hideshylayers | - | - | シャイレイヤーを隠す。 |
| motionblur | - | - | モーションブラーをオンにする。 |
| draft3d | - | - | ドラフト3Dをオンにする。 |
| frameblending | - | - | フレームブレンドをオンにする。 |
| preservenestedframerate | - | - | ネスト化されたコンポジションのフレームレートを保持する。 |
| preservenestedresolution | - | - | ネスト化されたコンポジションの解像度を保持する。 |
| shutterangle | number | - | シャッターアングルをvalue1にする。 |
| shutterphase | number | - | シャッターフェイズをvalue1にする。 |
| motionblursamplesperframe | number | - | モーションブラーのサンプル数をvalue1にする。 |
| motionbluradaptivesamplelimit | number | - | モーションブラーの最大サンプル数をvalue1にする。 |
レイヤーに対するフィルタ群。(参照: string(op), Path)
typeの頭に!を付けると反転できる。
例: null(ヌルレイヤーのみを通す) -> !null(ヌルレイヤー以外を通す)
valueをとるフィルタは配列で指定する。
例: ['x', '<=400'] (位置のxが400以下)
| type | value1 | value2 | value3 | 説明 |
|---|---|---|---|---|
| av | - | - | - | AVレイヤー。 |
| text | - | - | - | テキストレイヤー。 |
| shape | - | - | - | シェイプレイヤー。 |
| camera | - | - | - | カメラレイヤー。 |
| light | - | - | - | ライトレイヤー。 |
| index | string(op) | - | - | インデックスの比較。 |
| name | string | - | - | レイヤーの名前にvalue1を含む。 |
| nameindex | string(op) | - | - | レイヤーの名前に含まれた自然数の比較。"Shape Layer 32"の場合、32。数字が含まれてない場合は1。 |
| hasparent | - | - | - | 親を持つ。 |
| parent | string | - | - | 親の名前にvalue1を含む。 |
| starttime | string(op) | - | - | 開始時間の比較。 |
| stretch | string(op) | - | - | タイムストレッチの比較。 |
| inpoint | string(op) | - | - | インポイントの比較。 |
| outpoint | string(op) | - | - | アウトポイントの比較。 |
| duration | string(op) | - | - | デュレーションの比較。 |
| enabled | - | - | - | 有効。 |
| solo | - | - | - | ソロ。 |
| shy | - | - | - | シャイ。 |
| locked | - | - | - | ロック。 |
| hasvideo | - | - | - | ビデオスイッチがある。 |
| active | - | - | - | アクティブである。 |
| null | - | - | - | ヌルレイヤー。 |
| comment | string | - | - | コメントにvalue1を含む。 |
| selected | - | - | - | 選択されている。 |
| isnameset | - | - | - | 名前が明示的に設定されている。 |
| marker | string | string | number | value1: "comment" or "url" value3番目(default: 1)のマーカーのvalue1にvalue2を含む。 |
| solid | - | - | - | 平面レイヤー。 |
| file | - | - | - | ソースがファイルから読み込まれている。 |
| still | - | - | - | フッテージが静止画。 |
| comp | - | - | - | ソースがコンポジション。 |
| source | string | - | - | ソースの名前にvalue1を含む。 |
| audio | - | - | - | オーディオが有効。 |
| audiolayer | - | - | - | オーディオコンポーネントだけのレイヤー。 |
| motionblur | - | - | - | モーションブラーがオン。 |
| effects | - | - | - | エフェクトが有効。 |
| effect | string | - | - | value1の名前を含む、またはvalue1がマッチネームであるエフェクトが掛かっている。 |
| adjustment | - | - | - | 調整レイヤー。 |
| guide | - | - | - | ガイドレイヤー。 |
| 3d | - | - | - | 3Dレイヤーである。 |
| 2d | - | - | - | 2Dレイヤーである。 |
| environment | - | - | - | 環境レイヤーである。 |
| collapse | - | - | - | コラップスがオン。 |
| frameblending | - | - | - | フレームブレンドがオン。 |
| timeremap | - | - | - | タイムリマップがオン。 |
| hasaudio | - | - | - | オーディオコンポーネントを含む。 |
| isaudioactive | - | - | - | オーディオがアクティブ。 |
| istrackmatte | - | - | - | トラックマットである。 |
| hastrackmatte | - | - | - | トラックマットを持っている。 |
| quality | string | - | - | value1: "best", "draft" or "wireframe" 画質設定がvalue1である。 |
| autoorient | string | - | - | value1: "alongpath", "towardscamera", "characterstowardcamera" or "off" 自動方向がvalue1である。 |
| sampling | string | - | - | value1: "bicubic" or "bilinear" サンプリングがvalue1である。 |
| random | number | - | - | value1の確率で選択される。 |
| blend | string | - | - | value1: Blend参照。 合成モードがvalue1である。 |
| path | array(path) / string(path) | - | - | value1のプロパティを持つ。 |
| key | array(path) / string(path) | - | - | value1のプロパティにキーフレームが打たれている。 |
| ex | array(path) / string(path) | - | - | value1のプロパティにエクスプレッションが設定してある。 |
| width | string(op) | - | - | 幅の比較。 |
| height | string(op) | - | - | 高さの比較。 |
| xanchor | string(op) | - | - | アンカーポイントのxの比較。 |
| yanchor | string(op) | - | - | アンカーポイントのyの比較。 |
| zanchor | string(op) | - | - | アンカーポイントのzの比較。 |
| x | string(op) | - | - | 位置のxの比較。 |
| y | string(op) | - | - | 位置のyの比較。 |
| z | string(op) | - | - | 位置のzの比較。 |
| xscale | string(op) | - | - | スケールのxの比較。 |
| yscale | string(op) | - | - | スケールのyの比較。 |
| zscale | string(op) | - | - | スケールのzの比較。 |
| xorientation | string(op) | - | - | 方向のxの比較。 |
| yorientation | string(op) | - | - | 方向のyの比較。 |
| zorientation | string(op) | - | - | 方向のzの比較。 |
| none | - | - | - | 全て通さない。 |
| all | - | - | - | すべて通す。 |
| array(path) / string(path) | string(op) | - | - | パスによって指定されたプロパティ(oneDのみ対象)の値の比較。 |
レイヤーに対する属性付加等のコマンド群。(参照: string(op), Path)
typeの頭に!を付けるとvalue1, value2の値をとらないものは反転することが出来る。
例: solo(ソロにする) -> !solo(ソロをオフにする)
| type | value1 | value2 | 説明 |
|---|---|---|---|
| remove | - | - | リムーブする。 |
| name | string | string | レイヤーの名前の前にvalue1を後ろにvalue2を加える。 |
| enabled | - | - | 有効にする。 |
| solo | - | - | ソロにする。 |
| shy | - | - | シャイにする。 |
| locked | - | - | ロックする。 |
| comment | string | - | コメントをvalue1にする。 |
| starttime | number | - | 開始時間をvalue1にする。 |
| stretch | number | - | タイムストレッチをvalue1にする。 |
| inpoint | number | - | インポイントをvalue1にする。 |
| outpoint | number | - | アウトポイントをvalue1にする。 |
| width | number | - | 幅をvalue1にする。 |
| height | number | - | 高さをvalue1にする。 |
| audio | - | - | オーディオを有効にする。 |
| motionblur | - | - | モーションブラーをオンにする。 |
| effects | - | - | エフェクトを有効にする。 |
| adjustment | - | - | 調整レイヤーにする。 |
| guide | - | - | ガイドレイヤーにする。 |
| 2d | - | - | 2Dにする。 |
| 3d | - | - | 3Dにする。 |
| environment | - | - | 環境レイヤーにする。 |
| collapse | - | - | コラップスをオンにする。 |
| timeremap | - | - | タイムリマップをオンにする。 |
| parent | number / null | - | 親をインデックスがvalue1のレイヤーにする(number)。 親をNoneにする(null)。 |
| blend | string | - | value1: Blend参照。 合成モードをvalue1にする。 |
| quality | string | - | value1: "best", "draft" or "wireframe" 画質設定をvalue1にする。 |
| autoorient | string | - | value1: "alongpath", "towardscamera", "characterstowardcamera" or "off" 自動方向をvalue1にする。 |
| sampling | string | - | value1: "bicubic" or "bilinear" サンプリングをvalue1にする。 |
| xanchor | number | - | アンカーポイントのxをvalue1にする。 |
| yanchor | number | - | アンカーポイントのyをvalue1にする。 |
| zanchor | number | - | アンカーポイントのzをvalue1にする。 |
| x | number | - | 位置のxをvalue1にする。 |
| y | number | - | 位置のyをvalue1にする。 |
| z | number | - | 位置のzをvalue1にする。 |
| xscale | number | - | スケールのxをvalue1にする。 |
| yscale | number | - | スケールのyをvalue1にする。 |
| zscale | number | - | スケールのzをvalue1にする。 |
| xorientation | number | - | 方向のxをvalue1にする。 |
| yorientation | number | - | 方向のyをvalue1にする。 |
| zorientation | number | - | 方向のzをvalue1にする。 |
| effect | string | - | 名前もしくはマッチネームがvalue1のエフェクトを加える。 |
| dup | number | - | value1回複製する。 |
| ex | array(path) / string(path) | string | value1のプロパティのエクスプレッションをvalue2にする。 |
| key | array(path) / string(path) | number / array | value1のプロパティの値をvalue2にしてかつキーフレームを打つ。 |
| array(path) / string(path) | number / array | - | typeによって指定されたプロパティの値をvalue1にする。 |
プロパティに値を設定する際は、単純に数値で指定するだけでなく、+=30, -=100, *=2, /=2, %=640といった指定もできる。
数値比較用の書式を説明する。便宜上、比較対象のプロパティの値をvalue、<=, >=, <, >, ==, != の比較演算子をcmpとし、また、+, -, *, /, % の算術演算子をarithとする。
cmp 数: 基本的な形、単純にvalueと数を比較する。 例) ==3, >10
arith 数1 cmp 数2: (value arith 数1)の結果と数2を比較する。例) -1==3, %3<=1
arith1 数1 arith2 数2 cmp 数3: ((value arith1 数1) arith2 数2)の結果と数3を比較する。 例) -1%3==0, -240*2<400
プロパティを指定する際はパスを用いることになるが(例: 位置の場合、["Transform", "Position"])、getPathFromStringを用いることによっていくつかのプロパティは文字列で取得することが出来る。
| Path | 説明 |
|---|---|
| タイムリマップ | - |
| timeremap | タイムリマップ |
| トランスフォーム | - |
| anchor / anchorpoint | アンカーポイント |
| position | 位置 |
| xposition | X 位置(次元分割時) |
| yposition | Y 位置(次元分割時) |
| zposition | Z 位置(次元分割時) |
| scale | スケール |
| orientation | 方向 |
| rotation | 回転 |
| xrotation | X 回転 |
| yrotation | Y 回転 |
| zrotation | Z 回転 |
| opacity | 不透明度 |
| appearsinreflections | 反射内に表示 |
| マテリアル | - |
| materialcastsshadows | シャドウを落とす |
| materiallighttransmission | ライト透過 |
| materialacceptsshadows | シャドウを受ける |
| materialacceptslights | ライトを受ける |
| materialappearsinreflections | 反射内に表示 |
| materialambient | アンビエント |
| materialdiffuse | 拡散 |
| materialspecularintensity | 鏡面強度 |
| materialspecularshininess | 鏡面光沢 |
| materialmetal | 金属 |
| materialreflectionintensity | 反射強度 |
| materialreflectionsharpness | 反射シャープネス |
| materialreflectionrolloff | 反射ロールオフ |
| materialtransparency | 透明度 |
| materialtransparencyrolloff | 透明度ロールオフ |
| materialindexofrefraction | 屈折率 |
| 形状 | - |
| geometrycurvature | 曲率 |
| geometrysegments | 線分数 |
| geometrybevelstyle | ベベルのスタイル |
| geometrybeveldepth | ベベルの深さ |
| geometryholebeveldepth | 内枠のベベルの深さ |
| geometryextrusiondepth | 押し出す深さ |
| カメラ | - |
| zoom | ズーム |
| depthoffield | 被写界深度 |
| focusdistance | フォーカス距離 |
| aperture | 絞り |
| blurlevel | ブラーレベル |
| irisshape | アイリスの形状 |
| irisrotation | アイリスの回転 |
| irisaspectratio | アイリスの真円率 |
| irisdiffractionfringe | アイリスの回折フリンジ |
| highlightgain | ハイライトのゲイン |
| highlightthreshold | ハイライトのしきい値 |
| highlightsaturation | ハイライトの彩度 |
| ライト | - |
| lightintensity | 強度 |
| lightcolor | カラー |
| lightconeangle | 円錐頂角 |
| lightconefeather | 円錐ぼかし |
| lightfalloff | フォールオフ |
| lightfalloffradius | 半径 |
| lightfalloffdistance | フォールオフの距離 |
| lightcastsshadows | シャドウを落とす |
| lightshadowdarkness | シャドウの暗さ |
| lightshadowdiffusion | シャドウの拡散 |
| Blend | 説明 |
|---|---|
| add | 加算 |
| alphaadd | アルファ追加 |
| classiccolorburn | 焼き込みカラー(クラシック) |
| classiccolordodge | 覆い焼きカラー(クラシック) |
| classicdifference | 差(クラシック) |
| color | カラー |
| colorburn | 焼き込みカラー |
| colordodge | 覆い焼きカラー |
| dancingdissolve | ダイナミックディザ合成 |
| darken | 比較(暗) |
| darkencolor | カラー比較(暗) |
| difference | 差 |
| dissolve | ディザ合成 |
| exclusion | 除外 |
| hardlight | ハードライト |
| hardmix | ハードミックス |
| hue | 色相 |
| lighten | 比較(明) |
| lightercolor | カラー比較(明) |
| linearburn | 焼き込みリニア |
| lineardodge | 覆い焼きリニア |
| linearlight | リニアライト |
| luminescentpremul | ルミナンスキープリマルチプライ |
| luminosity | 輝度 |
| multiply | 乗算 |
| normal | 通常 |
| overlay | オーバーレイ |
| pinlight | ピンライト |
| saturation | 彩度 |
| screen | スクリーン |
| silhouetealpha silhouettealpha | シルエットアルファ |
| silhouetteluma | シルエットルミナンスキー |
| softlight | ソフトライト |
| stencilalpha | ステンシルアルファ |
| stencilluma | ステンシルルミナンス |
| vividlight | ビビッドライト |
代表値。
| Type | 説明 |
|---|---|
| minimum | 最小値。 |
| maximum | 最大値。 |
| center | 真ん中の値。(max + min) / 2 |
| median | 中央値。 |
| mean | 平均値。 |
KikakuUtils-0.2.0.zip
v0.2.0 - 2015/01/04 いくつかの関数の追加。
v0.1.0 - 2014/11/01 バグフィクス。いくつかの関数の追加。
v0.0.0 - 2014/08/17